url
stringlengths
36
137
content
stringlengths
1.21k
7.75M
https://www.mongodb.com/docs/manual/storage/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Storage <a class="headerlink leafygreen-ui-1kepx47" href="#storage" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="storage"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/storage-engines/#std-label-storage-engines"> storage engine </a> is the primary component of MongoDB responsible for managing data. MongoDB provides a variety of storage engines, allowing you to choose one most suited to your application. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-journal"> journal </a> is a log that helps the database recover in the event of a hard shutdown. There are several configurable options that allows the journal to strike a balance between performance and reliability that works for your particular use case. </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/gridfs/"> GridFS for Self-Managed Deployments </a> is a versatile storage system that is suited to handling large files, such as those exceeding the 16 MB document size limit. </p> </section>
https://www.mongodb.com/docs/manual/reference/method/cursor.toArray/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> cursor.toArray() <a class="headerlink leafygreen-ui-1kepx47" href="#cursor.toarray--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="cursor.toarray--"> </div> </a> </h1> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> cursor.toArray() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-cursor.toArray" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-cursor.toArray"> </div> </a> </dt> <dd> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> mongosh Method </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page documents a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> method. This is <em> not </em> the documentation for a language-specific driver, such as Node.js. </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB API drivers, refer to the language-specific <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB driver documentation <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-cursor.toArray" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> toArray() </code> </span> </a> method returns an array that contains all the documents from a cursor. The method iterates completely the cursor, loading all the documents into RAM and exhausting the cursor. </p> <table class="css-11h39yh e1nex8bq0"> <colgroup> <col class="field-name"/> <col class="field-body"/> </colgroup> <tbody> <tr class="css-x8snli"> <th> Returns <!-- --> : </th> <td> An array of documents. </td> </tr> </tbody> </table> </dd> </dl> <p class="leafygreen-ui-1kp3ins"> Consider the following example that applies <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-cursor.toArray" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> toArray() </code> </span> </a> to the cursor returned from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find() </code> </a> method: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var allProductsArray = db.products.find().toArray();\n\nif (allProductsArray.length &gt; 0) { printjson (allProductsArray[0]); }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> allProductsArray <!-- -->= <!-- -->db.<span class="lg-highlight-property">products</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">toArray</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->allProductsArray.<span class="lg-highlight-property">length</span> <!-- -->&gt; <span class="lg-highlight-number">0</span>) <!-- -->{ <!-- -->printjson <!-- -->(<!-- -->allProductsArray<!-- -->[<span class="lg-highlight-number">0</span>])<!-- -->; <!-- -->}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The variable <code class="leafygreen-ui-1l06pbn"> allProductsArray </code> holds the array of documents returned by <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-cursor.toArray" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> toArray() </code> . </span> </a> </p> </section>
https://www.mongodb.com/docs/manual/reference/operator/query/centerSphere/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $centerSphere <a class="headerlink leafygreen-ui-1kepx47" href="#-centersphere" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-centersphere"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="query"> <dt> <code class="leafygreen-ui-1l06pbn"> $centerSphere </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-query-op.-centerSphere" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-query-op.-centerSphere"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Defines a circle for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-geospatial"> geospatial </a> query that uses spherical geometry. The query returns documents that are within the bounds of the circle. You can use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-centerSphere" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $centerSphere </code> </span> </a> operator on both <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-GeoJSON"> GeoJSON </a> objects and legacy coordinate pairs. </p> <p class="leafygreen-ui-1kp3ins"> To use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-centerSphere" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $centerSphere </code> </span> </a> , specify an array that contains: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The grid coordinates of the circle's center point, and </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The circle's radius measured in radians. To calculate radians, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/calculate-distances/#std-label-calculate-distance-spherical-geometry"> Convert Distance to Radians for Spherical Operators <!-- --> . </a> </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n &lt;location&gt;: {\n $geoWithin: { $centerSphere: [ [ &lt;x&gt;, &lt;y&gt; ], &lt;radius&gt; ] }\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->&lt;location field&gt;: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> $geoWithin: { $centerSphere: [ [ &lt;x&gt;, &lt;y&gt; ], &lt;radius&gt; ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> If you use longitude and latitude, specify longitude first. </strong> </h3> <div class="leafygreen-ui-9mycqc"> </div> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Applications can use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-centerSphere" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $centerSphere </code> </span> </a> <em> without </em> having a geospatial index. However, geospatial indexes support much faster queries than the unindexed equivalents. </p> <p class="leafygreen-ui-1kp3ins"> Both <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index"> 2d </a> geospatial indexes support <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-centerSphere" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $centerSphere </code> . </span> </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example queries grid coordinates and returns all documents within a 10 mile radius of longitude <code class="leafygreen-ui-1l06pbn"> 88 W </code> and latitude <code class="leafygreen-ui-1l06pbn"> 30 N </code> . The query converts the distance to radians by dividing by the approximate equatorial radius of the earth, 3963.2 miles: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.places.find( {\n loc: { $geoWithin: { $centerSphere: [ [ -88, 30 ], 10/3963.2 ] } }\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">places</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">loc</span>: <!-- -->{ <span class="lg-highlight-attr">$geoWithin</span>: <!-- -->{ <span class="lg-highlight-attr">$centerSphere</span>: <!-- -->[ <!-- -->[ <!-- -->-<span class="lg-highlight-number">88</span>, <span class="lg-highlight-number">30</span> ]<!-- -->, <span class="lg-highlight-number">10</span>/<span class="lg-highlight-number">3963.2</span> ] } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/core/queryable-encryption/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Queryable Encryption <a class="headerlink leafygreen-ui-1kepx47" href="#queryable-encryption" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="queryable-encryption"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#introduction" target="_self"> <span> Introduction </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#considerations" target="_self"> <span> Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#mongodb-support-limitations" target="_self"> <span> MongoDB Support Limitations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#features" target="_self"> <span> Features </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#installation" target="_self"> <span> Installation </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#quick-start" target="_self"> <span> Quick Start </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#fundamentals" target="_self"> <span> Fundamentals </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#tutorials" target="_self"> <span> Tutorials </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#reference" target="_self"> <span> Reference </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Introduction <a class="headerlink leafygreen-ui-1kepx47" href="#introduction" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="introduction"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption gives you the ability to perform the following tasks: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Encrypt sensitive data fields from the client-side. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Store sensitive data fields as fully randomized encrypted data on the database server-side. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Run expressive queries on the encrypted data. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> These tasks are all completed without the server having knowledge of the data it's processing. </p> <p class="leafygreen-ui-1kp3ins"> Sensitive data is encrypted throughout its lifecycle - in-transit, at-rest, in-use, in logs, and backups - and only ever decrypted on the client-side, since only you have access to the encryption keys. </p> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption introduces an industry-first fast, searchable encryption scheme developed by the pioneers in encrypted search. The feature supports equality and range searches, with additional query types such as prefix, suffix, and substring planned for future releases. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-manual-qe-mechanisms"> </span> <p class="leafygreen-ui-1kp3ins"> You can set up Queryable Encryption using the following mechanisms: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Automatic Encryption: Enables you to perform encrypted read and write operations without having to add explicit calls to encrypt and decrypt fields. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Explicit Encryption: Enables you to perform encrypted read and write operations through your MongoDB driver's encryption library. You must specify the logic for encryption with this library throughout your application. </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#considerations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="considerations"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> When implementing an application that uses Queryable Encryption, consider the points listed in <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/about-qe-csfle/#std-label-qe-csfle-security-considerations"> Security Considerations <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> For other limitations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/limitations/#std-label-qe-reference-encryption-limits"> Queryable Encryption limitations <!-- --> . </a> </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To learn which MongoDB server products and drivers support Queryable Encryption, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/compatibility/#std-label-qe-compatibility-reference"> Queryable Encryption Compatibility <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> MongoDB Support Limitations <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-support-limitations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-support-limitations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Enabling Queryable Encryption on a collection redacts fields from some diagnostic commands and omits some operations from the query log. This limits the data available to MongoDB support engineers, especially when analyzing query performance. To measure the impact of operations against encrypted collections, use a third party application performance monitoring tool to collect metrics. </p> <p class="leafygreen-ui-1kp3ins"> For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/limitations/#std-label-qe-redaction"> Redaction <!-- --> . </a> </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Features <a class="headerlink leafygreen-ui-1kepx47" href="#features" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="features"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To learn about the security benefits of Queryable Encryption for your applications, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/features/#std-label-qe-features"> Features </a> page. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Installation <a class="headerlink leafygreen-ui-1kepx47" href="#installation" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="installation"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To learn what you must install to use Queryable Encryption, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/install/#std-label-qe-install"> Install a Queryable Encryption Compatible Driver </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/install-library/#std-label-qe-csfle-install-library"> Install and Configure a Queryable Encryption Library </a> pages. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Quick Start <a class="headerlink leafygreen-ui-1kepx47" href="#quick-start" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="quick-start"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To start using Queryable Encryption, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/quick-start/#std-label-qe-quick-start"> Quick Start <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Fundamentals <a class="headerlink leafygreen-ui-1kepx47" href="#fundamentals" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="fundamentals"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To learn about encryption key management, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/keys-key-vaults/#std-label-qe-reference-keys-key-vaults"> Encryption Keys and Key Vaults <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To learn how Queryable Encryption works, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/#std-label-qe-fundamentals"> Fundamentals </a> section, which contains the following pages: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/encrypt-and-query/#std-label-qe-fundamentals-encrypt-query"> Encrypted Fields and Enabled Queries </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/qe-create-encryption-schema/#std-label-qe-create-encryption-schema"> Create an Encryption Schema </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/manage-collections/#std-label-qe-fundamentals-collection-management"> Encrypted Collections </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/manual-encryption/#std-label-qe-fundamentals-manual-encryption"> Explicit Encryption </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/manage-keys/#std-label-qe-fundamentals-manage-keys"> Rotate and Rewrap Encryption Keys </a> </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Tutorials <a class="headerlink leafygreen-ui-1kepx47" href="#tutorials" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="tutorials"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To learn how to perform specific tasks with Queryable Encryption, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/tutorials/#std-label-qe-tutorials"> Tutorials </a> section. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Reference <a class="headerlink leafygreen-ui-1kepx47" href="#reference" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="reference"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To view information to help you develop your Queryable Encryption enabled applications, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/#std-label-qe-reference"> Reference </a> section. </p> <p class="leafygreen-ui-1kp3ins"> The reference section contains the following pages: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/supported-operations/#std-label-qe-reference-automatic-encryption-supported-operations"> Supported Operations for Queryable Encryption </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/qe-options-clients/#std-label-qe-reference-mongo-client"> MongoClient Options for Queryable Encryption </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/query/box/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $box <a class="headerlink leafygreen-ui-1kepx47" href="#-box" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-box"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="query"> <dt> <code class="leafygreen-ui-1l06pbn"> $box </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-query-op.-box" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-query-op.-box"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies a rectangle for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-geospatial"> geospatial </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/geoWithin/#mongodb-query-op.-geoWithin"> <code class="leafygreen-ui-1l06pbn"> $geoWithin </code> </a> query to return documents that are within the bounds of the rectangle, according to their point-based location data. When used with the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-box" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $box </code> </span> </a> operator, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/geoWithin/#mongodb-query-op.-geoWithin"> <code class="leafygreen-ui-1l06pbn"> $geoWithin </code> </a> returns documents based on <a class="leafygreen-ui-tqgtui" href="/docs/manual/geospatial-queries/#std-label-geospatial-legacy"> grid coordinates </a> and does <em> not </em> query for GeoJSON shapes. </p> <p class="leafygreen-ui-1kp3ins"> To use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-box" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $box </code> </span> </a> operator, you must specify the bottom left and top right corners of the rectangle in an array object: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n &lt;location&gt;: {\n $geoWithin: {\n $box: [\n [ &lt;bottom&gt; ],\n [ &lt;upper&gt; ]\n ]\n }\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->&lt;location field&gt;: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> $geoWithin: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> $box: [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [ &lt;bottom left coordinates&gt; ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [ &lt;upper right coordinates&gt; ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> If you use longitude and latitude, specify longitude first. </strong> </h3> <div class="leafygreen-ui-9mycqc"> </div> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The query calculates distances using flat (planar) geometry. </p> <p class="leafygreen-ui-1kp3ins"> Applications can use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-box" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $box </code> </span> </a> <em> without </em> having a geospatial index. However, geospatial indexes support much faster queries than the unindexed equivalents. </p> <p class="leafygreen-ui-1kp3ins"> Only the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index"> 2d </a> geospatial index supports <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-box" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $box </code> . </span> </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example query returns all documents that are within the box having points at: <code class="leafygreen-ui-1l06pbn"> [ 0 , 0 ] </code> , <code class="leafygreen-ui-1l06pbn"> [ 0 , 100 ] </code> , <code class="leafygreen-ui-1l06pbn"> [ 100 , 0 ] </code> , and <code class="leafygreen-ui-1l06pbn"> [ 100 , 100 ] </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.places.find( {\n loc: { $geoWithin: { $box: [ [ 0, 0 ], [ 100, 100 ] ] } }\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">places</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">loc</span>: <!-- -->{ <span class="lg-highlight-attr">$geoWithin</span>: <!-- -->{ <span class="lg-highlight-attr">$box</span>: <!-- -->[ <!-- -->[ <span class="lg-highlight-number">0</span>, <span class="lg-highlight-number">0</span> ]<!-- -->, <!-- -->[ <span class="lg-highlight-number">100</span>, <span class="lg-highlight-number">100</span> ] ] } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/deploy-replica-set-with-keyfile-access-control/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Deploy Self-Managed Replica Set With Keyfile Authentication <a class="headerlink leafygreen-ui-1kepx47" href="#deploy-self-managed-replica-set-with-keyfile-authentication" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="deploy-self-managed-replica-set-with-keyfile-authentication"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#overview" target="_self"> <span> Overview </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#considerations" target="_self"> <span> Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#deploy-new-replica-set-with-keyfile-access-control" target="_self"> <span> Deploy New Replica Set with Keyfile Access Control </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#x.509-internal-authentication" target="_self"> <span> x.509 Internal Authentication </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Overview <a class="headerlink leafygreen-ui-1kepx47" href="#overview" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="overview"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Enforcing access control on a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> requires configuring: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Security between members of the replica set using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-replica-set-security"> Internal Authentication </a> , and </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Security between connecting clients and the replica set using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/"> Role-Based Access Control in Self-Managed Deployments <!-- --> . </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For this tutorial, each member of the replica set uses the same internal authentication mechanism and settings. </p> <p class="leafygreen-ui-1kp3ins"> Enforcing internal authentication also enforces user access control. To connect to the replica set, clients like <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> need to use a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/#std-label-authorization"> user account </a> . See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-security-repSetDeploy-access-control" target="_self"> <span> Users and Authentication Mechanisms <!-- --> . </span> </a> </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Cloud Manager and Ops Manager <a class="headerlink leafygreen-ui-1kepx47" href="#cloud-manager-and-ops-manager" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="cloud-manager-and-ops-manager"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you are currently using or are planning to use Cloud Manager or Ops Manager, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/cloud-manager/tutorial/edit-host-authentication-credentials/" target="_self"> <span> Cloud Manager manual </span> </a> or the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/ops-manager/current/tutorial/edit-host-authentication-credentials/" target="_self"> <span> Ops Manager manual </span> </a> for enforcing access control. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#considerations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="considerations"> </div> </a> </h2> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To avoid configuration updates due to IP address changes, use DNS hostnames instead of IP addresses. It is particularly important to use a DNS hostname instead of an IP address when configuring replica set members or sharded cluster members. </p> <p class="leafygreen-ui-1kp3ins"> Use hostnames instead of IP addresses to configure clusters across a split network horizon. Starting in MongoDB 5.0, nodes that are only configured with an IP address fail startup validation and do not start. </p> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> IP Binding <a class="headerlink leafygreen-ui-1kepx47" href="#ip-binding" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="ip-binding"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> bind to localhost by default. If the members of your deployment are run on different hosts or if you wish remote clients to connect to your deployment, you must specify <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Operating System <a class="headerlink leafygreen-ui-1kepx47" href="#operating-system" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="operating-system"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> This tutorial primarily refers to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process. Windows users should use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod.exe/#mongodb-binary-bin.mongod.exe"> <code class="leafygreen-ui-1l06pbn"> mongod.exe </code> </a> program instead. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Keyfile Security <a class="headerlink leafygreen-ui-1kepx47" href="#keyfile-security" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="keyfile-security"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Keyfiles are bare-minimum forms of security and are best suited for testing or development environments. For production environments we recommend using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-x.509/#std-label-security-auth-x509"> x.509 certificates <!-- --> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-security-repSetDeploy-access-control"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Users and Authentication Mechanisms <a class="headerlink leafygreen-ui-1kepx47" href="#users-and-authentication-mechanisms" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="users-and-authentication-mechanisms"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> This tutorial covers creating the minimum number of administrative users on the <code class="leafygreen-ui-1l06pbn"> admin </code> database <em> only </em> . For the user authentication, the tutorial uses the default <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-scram/#std-label-authentication-scram"> SCRAM </a> authentication mechanism. Challenge-response security mechanisms are best suited for testing or development environments. For production environments, we recommend using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-x.509/#std-label-security-auth-x509"> x.509 certificates </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-ldap/#std-label-security-ldap"> Self-Managed LDAP Proxy Authentication </a> (available for MongoDB Enterprise only) or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/kerberos/#std-label-security-kerberos"> Kerberos Authentication on Self-Managed Deployments </a> (available for MongoDB Enterprise only). </p> <p class="leafygreen-ui-1kp3ins"> For details on creating users for specific authentication mechanism, refer to the specific authentication mechanism pages. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-security-checklist-role-based-access-control"> ➤ <!-- --> Configure Role-Based Access Control </a> for best practices for user creation and management. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-security-replica-deploy-with-access-control"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Deploy New Replica Set with Keyfile Access Control <a class="headerlink leafygreen-ui-1kepx47" href="#deploy-new-replica-set-with-keyfile-access-control" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="deploy-new-replica-set-with-keyfile-access-control"> </div> </a> </h2> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To avoid configuration updates due to IP address changes, use DNS hostnames instead of IP addresses. It is particularly important to use a DNS hostname instead of an IP address when configuring replica set members or sharded cluster members. </p> <p class="leafygreen-ui-1kp3ins"> Use hostnames instead of IP addresses to configure clusters across a split network horizon. Starting in MongoDB 5.0, nodes that are only configured with an IP address fail startup validation and do not start. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Create a keyfile.With keyfile authentication, each\nmongod instances in the replica set uses the contents of the keyfile as the\nshared password for authenticating other members in the deployment. Only\nmongod instances with the correct keyfile can join the replica set.Keyfiles for internal membership authentication use YAML format to allow for multiple keys in a\nkeyfile. The YAML format accepts either:A single key string (same as in earlier versions)A sequence of key stringsThe YAML format is compatible with the existing single-key\nkeyfiles that use the text file format.A key's length must be between 6 and 1024 characters and may only\ncontain characters in the base64 set. All members of the\nreplica set must share at least one common key.On UNIX systems, the keyfile must not have group or world\npermissions. On Windows systems, keyfile permissions are not checked.You can generate a keyfile using any method you choose. For example,\nthe following operation uses openssl to generate a complex\npseudo-random 1024 character string to use as a shared password. It then\nuses chmod to change file permissions to provide read\npermissions for the file owner only:See Keyfiles for additional details and requirements\nfor using keyfiles."},{"@type":"HowToStep","text":"Copy the keyfile to each replica set member.Copy the keyfile to each server hosting the replica set members.\nEnsure that the user running the mongod instances is the owner of the\nfile and can access the keyfile.Avoid storing the keyfile on storage mediums that can be easily\ndisconnected from the hardware hosting the mongod instances, such as a\nUSB drive or a network attached storage device."},{"@type":"HowToStep","text":"Start each member of the replica set with access control enabled.For each member in the replica set, start the mongod with\neither the security.keyFile configuration file setting or\nthe --keyFile command-line option. Running mongod\nwith the --keyFile command-line option or the\nsecurity.keyFile configuration file setting enforces both\nSelf-Managed Internal/Membership Authentication and\nRole-Based Access Control in Self-Managed Deployments.Configuration FileIf using a configuration file, setsecurity.keyFile to the keyfile's path, andreplication.replSetName to the replica set name.Include additional options as required\nfor your configuration. For instance, if you wish remote clients to\nconnect to your deployment or your deployment members are run on\ndifferent hosts, specify the net.bindIp setting.Start the mongod using the configuration file:For more information on the configuration file, see\nconfiguration options.Command LineIf using the command line options, start the mongod with the following options:--keyFile set to the keyfile's path, and--replSet set to the replica set name.Include additional options as required for your configuration. For\ninstance, if you wish remote clients to connect to your deployment\nor your deployment members are run on different hosts, specify the\n--bind_ip.To avoid configuration updates due to IP address changes, use DNS\nhostnames instead of IP addresses. It is particularly important to\nuse a DNS hostname instead of an IP address when configuring replica\nset members or sharded cluster members.Use hostnames instead of IP addresses to configure clusters across a\nsplit network horizon. Starting in MongoDB 5.0, nodes that are only\nconfigured with an IP address fail startup validation and do not start.For more information on command-line options, see the\nmongod reference page."},{"@type":"HowToStep","text":"Connect to a member of the replica set over the localhost interface.Connect mongosh to one of the\nmongod instances over the localhost\ninterface. You must run mongosh\non the same physical machine as the mongod instance.The localhost interface is only available\nsince no users have been created for the deployment. The\nlocalhost interface closes after the\ncreation of the first user."},{"@type":"HowToStep","text":"Initiate the replica set.From mongosh, run the rs.initiate() method.rs.initiate() can take an optional replica set\nconfiguration document. In the\nreplica set configuration document, include:The _id field set to the replica set name specified in\neither the replication.replSetName or the --replSet\noption.The members array with a document per each member of the\nreplica set.The following example initates a three member replica set.Run rs.initiate() on only one mongod instance\nfor the replica set.To avoid configuration updates due to IP address changes, use DNS\nhostnames instead of IP addresses. It is particularly important to\nuse a DNS hostname instead of an IP address when configuring replica\nset members or sharded cluster members.Use hostnames instead of IP addresses to configure clusters across a\nsplit network horizon. Starting in MongoDB 5.0, nodes that are only\nconfigured with an IP address fail startup validation and do not start.rs.initiate() triggers an election and\nelects one of the members to be the primary.Connect to the primary before continuing. Use rs.status() to\nlocate the primary member."},{"@type":"HowToStep","text":"Create the user administrator.After you create the first user, the localhost exception is no longer available.The first user must have privileges to create other users, such\nas a user with the userAdminAnyDatabase. This ensures\nthat you can create additional users after the Localhost Exception in Self-Managed Deployments\ncloses.If at least one user does not have privileges to create users,\nonce the localhost exception closes you may be unable to create\nor modify users with new privileges, and therefore unable to\naccess necessary operations.Add a user using the db.createUser() method. The user should\nhave at minimum the userAdminAnyDatabase role on the\nadmin database.You must be connected to the primary to create users.The following example creates the user fred with the\nuserAdminAnyDatabase role on the admin database.Passwords should be random, long, and complex to ensure system security\nand to prevent or delay malicious access.You can use the passwordPrompt() method in conjunction with\nvarious user authentication management methods and commands to prompt\nfor the password instead of specifying the password directly in the\nmethod or command call. However, you can still specify the password\ndirectly as you would with earlier versions of the\nmongo shell.Enter the password when prompted.\nSee Database User Roles for a full list of built-in roles\nrelated to database administration operations."},{"@type":"HowToStep","text":"Authenticate as the user administrator.Authenticate to the admin database.In mongosh, use db.auth() to\nauthenticate. For example, the following authenticate as the user\nadministrator fred:You can use the passwordPrompt() method in conjunction with\nvarious user authentication management methods and commands to prompt\nfor the password instead of specifying the password directly in the\nmethod or command call. However, you can still specify the password\ndirectly as you would with earlier versions of the\nmongo shell.Alternatively, connect a new mongosh instance to\nthe primary replica set member using the -u <username>,\n-p <password>, and the --authenticationDatabase\nparameters.If you do not specify the password to the -p\ncommand-line option, mongosh prompts for the\npassword."},{"@type":"HowToStep","text":"Create the cluster administrator.The clusterAdmin role grants access to replication\noperations, such as configuring the replica set.Create a cluster administrator user and assign the\nclusterAdmin role in the admin database:You can use the passwordPrompt() method in conjunction with\nvarious user authentication management methods and commands to prompt\nfor the password instead of specifying the password directly in the\nmethod or command call. However, you can still specify the password\ndirectly as you would with earlier versions of the\nmongo shell.Enter the password when prompted.See Cluster Administration Roles for a full list of built-in roles related to\nreplica set and sharded cluster operations."},{"@type":"HowToStep","text":"Create additional users (Optional).Create users to allow clients to connect and interact with the replica set.\nSee Database User Roles for basic built-in roles to use in creating\nread-only and read-write users.You may also want additional administrative users.\nFor more information on users, see Users in Self-Managed Deployments."}],"name":"Deploy New Replica Set with Keyfile Access Control","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create a keyfile. <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-keyfile" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-a-keyfile"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> With <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-internal-auth-keyfile"> keyfile </a> authentication, each <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances in the replica set uses the contents of the keyfile as the shared password for authenticating other members in the deployment. Only <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances with the correct keyfile can join the replica set. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-internal-auth-keyfile"> Keyfiles for internal membership authentication </a> use YAML format to allow for multiple keys in a keyfile. The YAML format accepts either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A single key string (same as in earlier versions) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A sequence of key strings </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The YAML format is compatible with the existing single-key keyfiles that use the text file format. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> A key's length must be between 6 and 1024 characters and may only contain characters in the base64 set. All members of the replica set must share at least one common key. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> On UNIX systems, the keyfile must not have group or world permissions. On Windows systems, keyfile permissions are not checked. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> You can generate a keyfile using any method you choose. For example, the following operation uses <code class="leafygreen-ui-1l06pbn"> openssl </code> to generate a complex pseudo-random 1024 character string to use as a shared password. It then uses <code class="leafygreen-ui-1l06pbn"> chmod </code> to change file permissions to provide read permissions for the file owner only: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"openssl rand -base64 756 &gt; &lt;path-to-keyfile&gt;\nchmod 400 &lt;path-to-keyfile&gt;\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">openssl rand -base64 756 &gt; &lt;path-to-keyfile&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">chmod 400 &lt;path-to-keyfile&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-internal-auth-keyfile"> Keyfiles </a> for additional details and requirements for using keyfiles. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Copy the keyfile to each replica set member. <a class="headerlink leafygreen-ui-1kepx47" href="#copy-the-keyfile-to-each-replica-set-member" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="copy-the-keyfile-to-each-replica-set-member"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Copy the keyfile to each server hosting the replica set members. Ensure that the user running the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances is the owner of the file and can access the keyfile. </p> <p class="leafygreen-ui-1kp3ins"> Avoid storing the keyfile on storage mediums that can be easily disconnected from the hardware hosting the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances, such as a USB drive or a network attached storage device. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Start each member of the replica set with access control enabled. <a class="headerlink leafygreen-ui-1kepx47" href="#start-each-member-of-the-replica-set-with-access-control-enabled" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="start-each-member-of-the-replica-set-with-access-control-enabled"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> For each member in the replica set, start the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> with either the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.keyFile"> <code class="leafygreen-ui-1l06pbn"> security.keyFile </code> </a> configuration file setting or the <code class="leafygreen-ui-1l06pbn"> --keyFile </code> command-line option. Running <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> with the <code class="leafygreen-ui-1l06pbn"> --keyFile </code> command-line option or the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.keyFile"> <code class="leafygreen-ui-1l06pbn"> security.keyFile </code> </a> configuration file setting enforces both <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/"> Self-Managed Internal/Membership Authentication </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/"> Role-Based Access Control in Self-Managed Deployments <!-- --> . </a> </p> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Configuration File <a class="headerlink leafygreen-ui-1kepx47" href="#configuration-file" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="configuration-file"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> If using a configuration file, set </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.keyFile"> <code class="leafygreen-ui-1l06pbn"> security.keyFile </code> </a> to the keyfile's path, and </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> </a> to the replica set name. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> setting. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"security:\n keyFile: &lt;path-to-keyfile&gt;\nreplication:\n replSetName: &lt;replicasetname&gt;\nnet:\n bindIp: localhost,&lt;hostname(s)|ip&gt;\n","programmingLanguage":"YAML"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light yaml leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">security:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">keyFile:</span> <span class="lg-highlight-string">&lt;path-to-keyfile&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">replication:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">replSetName:</span> <span class="lg-highlight-string">&lt;replicaSetName&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">net:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bindIp:</span> <span class="lg-highlight-string">localhost,&lt;hostname(s)|ip</span> <span class="lg-highlight-string">address(es)&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <p class="leafygreen-ui-1kp3ins"> Start the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> using the configuration file: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --config &lt;path-to-config-file&gt;\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --config &lt;path-to-config-file&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on the configuration file, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#std-label-configuration-options"> configuration options <!-- --> . </a> </p> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Command Line <a class="headerlink leafygreen-ui-1kepx47" href="#command-line" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="command-line"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> If using the command line options, start the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> with the following options: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> --keyFile </code> set to the keyfile's path, and </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> --replSet </code> set to the replica set name. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --keyFile &lt;path-to-keyfile&gt; --replSet &lt;replicasetname&gt; --bind_ip localhost,&lt;hostname(s)|ip&gt;\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --keyFile &lt;path-to-keyfile&gt; --replSet &lt;replicaSetName&gt; --bind_ip localhost,&lt;hostname(s)|ip address(es)&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To avoid configuration updates due to IP address changes, use DNS hostnames instead of IP addresses. It is particularly important to use a DNS hostname instead of an IP address when configuring replica set members or sharded cluster members. </p> <p class="leafygreen-ui-1kp3ins"> Use hostnames instead of IP addresses to configure clusters across a split network horizon. Starting in MongoDB 5.0, nodes that are only configured with an IP address fail startup validation and do not start. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on command-line options, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> reference page. </p> </section> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Connect to a member of the replica set over the localhost interface. <a class="headerlink leafygreen-ui-1kepx47" href="#connect-to-a-member-of-the-replica-set-over-the-localhost-interface" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="connect-to-a-member-of-the-replica-set-over-the-localhost-interface"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Connect <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to one of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances over the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost interface </a> . You must run <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> on the same physical machine as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost interface </a> is only available since no users have been created for the deployment. The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost interface </a> closes after the creation of the first user. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Initiate the replica set. <a class="headerlink leafygreen-ui-1kepx47" href="#initiate-the-replica-set" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="initiate-the-replica-set"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> From <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , run the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.initiate/#mongodb-method-rs.initiate"> <code class="leafygreen-ui-1l06pbn"> rs.initiate() </code> </a> method. </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.initiate/#mongodb-method-rs.initiate"> <code class="leafygreen-ui-1l06pbn"> rs.initiate() </code> </a> can take an optional <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/"> replica set configuration document </a> . In the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/"> replica set configuration document </a> , include: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf._id"> <code class="leafygreen-ui-1l06pbn"> _id </code> </a> field set to the replica set name specified in either the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> </a> or the <code class="leafygreen-ui-1l06pbn"> --replSet </code> option. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members"> <code class="leafygreen-ui-1l06pbn"> members </code> </a> array with a document per each member of the replica set. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The following example initates a three member replica set. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.initiate/#mongodb-method-rs.initiate"> <code class="leafygreen-ui-1l06pbn"> rs.initiate() </code> </a> on <em> only one </em> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance for the replica set. </p> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To avoid configuration updates due to IP address changes, use DNS hostnames instead of IP addresses. It is particularly important to use a DNS hostname instead of an IP address when configuring replica set members or sharded cluster members. </p> <p class="leafygreen-ui-1kp3ins"> Use hostnames instead of IP addresses to configure clusters across a split network horizon. Starting in MongoDB 5.0, nodes that are only configured with an IP address fail startup validation and do not start. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"rs.initiate(\n {\n _id : \"myReplSet\",\n members: [\n { _id : 0, host : \"mongo1.example.net:27017\" },\n { _id : 1, host : \"mongo2.example.net:27017\" },\n { _id : 2, host : \"mongo3.example.net:27017\" }\n ]\n }\n)\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">initiate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->_id <!-- -->: <span class="lg-highlight-string">"myReplSet"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">members</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">0</span>, <!-- -->host <!-- -->: <span class="lg-highlight-string">"mongo1.example.net:27017"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">1</span>, <!-- -->host <!-- -->: <span class="lg-highlight-string">"mongo2.example.net:27017"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">2</span>, <!-- -->host <!-- -->: <span class="lg-highlight-string">"mongo3.example.net:27017"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.initiate/#mongodb-method-rs.initiate"> <code class="leafygreen-ui-1l06pbn"> rs.initiate() </code> </a> triggers an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-election"> election </a> and elects one of the members to be the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Connect to the primary before continuing. Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> to locate the primary member. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 6 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create the user administrator. <a class="headerlink leafygreen-ui-1kepx47" href="#create-the-user-administrator" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-the-user-administrator"> </div> </a> </h3> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> After you create the first user, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost exception </a> is no longer available. </p> <p class="leafygreen-ui-1kp3ins"> The first user must have privileges to create other users, such as a user with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-userAdminAnyDatabase"> <code class="leafygreen-ui-1l06pbn"> userAdminAnyDatabase </code> </a> . This ensures that you can create additional users after the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> Localhost Exception in Self-Managed Deployments </a> closes. </p> <p class="leafygreen-ui-1kp3ins"> If at least one user does <em> not </em> have privileges to create users, once the localhost exception closes you may be unable to create or modify users with new privileges, and therefore unable to access necessary operations. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Add a user using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createUser/#mongodb-method-db.createUser"> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </a> method. The user should have at minimum the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-userAdminAnyDatabase"> <code class="leafygreen-ui-1l06pbn"> userAdminAnyDatabase </code> </a> role on the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </p> <p class="leafygreen-ui-1kp3ins"> You must be connected to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> to create users. </p> <p class="leafygreen-ui-1kp3ins"> The following example creates the user <code class="leafygreen-ui-1l06pbn"> fred </code> with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-userAdminAnyDatabase"> <code class="leafygreen-ui-1l06pbn"> userAdminAnyDatabase </code> </a> role on the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Passwords should be random, long, and complex to ensure system security and to prevent or delay malicious access. </p> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"admin = db.getSiblingDB(\"admin\")\nadmin.createUser(\n {\n user: \"fred\",\n pwd: passwordPrompt(), // or cleartext password\n roles: [ { role: \"userAdminAnyDatabase\", db: \"admin\" } ]\n }\n)\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">admin <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<span class="lg-highlight-string">"admin"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">admin.<span class="lg-highlight-title lg-highlight-function">createUser</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">user</span>: <span class="lg-highlight-string">"fred"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pwd</span>: <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)<!-- -->, <span class="lg-highlight-comment">// or cleartext password</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"userAdminAnyDatabase"</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"admin"</span> } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Enter the password when prompted. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-database-user-roles"> Database User Roles </a> for a full list of built-in roles related to database administration operations. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 7 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Authenticate as the user administrator. <a class="headerlink leafygreen-ui-1kepx47" href="#authenticate-as-the-user-administrator" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="authenticate-as-the-user-administrator"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Authenticate to the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </p> <p class="leafygreen-ui-1kp3ins"> In <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.auth/#mongodb-method-db.auth"> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </a> to authenticate. For example, the following authenticate as the user administrator <code class="leafygreen-ui-1l06pbn"> fred </code> : </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.getSiblingDB(\"admin\").auth(\"fred\", passwordPrompt()) // or cleartext password\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<span class="lg-highlight-string">"admin"</span>).<span class="lg-highlight-title lg-highlight-function">auth</span>(<span class="lg-highlight-string">"fred"</span>, <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)) <span class="lg-highlight-comment">// or cleartext password</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Alternatively, connect a new <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> instance to the primary replica set member using the <code class="leafygreen-ui-1l06pbn"> -u &lt;username&gt; </code> , <code class="leafygreen-ui-1l06pbn"> -p &lt;password&gt; </code> , and the <code class="leafygreen-ui-1l06pbn"> --authenticationDatabase </code> parameters. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh -u \"fred\" -p --authenticationDatabase \"admin\"\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh -u "fred" -p --authenticationDatabase "admin"</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If you do not specify the password to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-option-mongosh.--password" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> -p </code> </span> </a> command-line option, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> prompts for the password. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 8 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create the cluster administrator. <a class="headerlink leafygreen-ui-1kepx47" href="#create-the-cluster-administrator" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-the-cluster-administrator"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-clusterAdmin"> <code class="leafygreen-ui-1l06pbn"> clusterAdmin </code> </a> role grants access to replication operations, such as configuring the replica set. </p> <p class="leafygreen-ui-1kp3ins"> Create a cluster administrator user and assign the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-clusterAdmin"> <code class="leafygreen-ui-1l06pbn"> clusterAdmin </code> </a> role in the <code class="leafygreen-ui-1l06pbn"> admin </code> database: </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.getSiblingDB(\"admin\").createUser(\n {\n \"user\" : \"ravi\",\n \"pwd\" : passwordPrompt(), // or cleartext password\n roles: [ { \"role\" : \"clusterAdmin\", \"db\" : \"admin\" } ]\n }\n)\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.getSiblingDB("admin").createUser(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "user" : "ravi",</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "pwd" : passwordPrompt(), // or cleartext password</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> roles: [ { "role" : "clusterAdmin", "db" : "admin" } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Enter the password when prompted. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-cluster-admin-roles"> Cluster Administration Roles </a> for a full list of built-in roles related to replica set and sharded cluster operations. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 9 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create additional users (Optional). <a class="headerlink leafygreen-ui-1kepx47" href="#create-additional-users-optional" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-additional-users-optional"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Create users to allow clients to connect and interact with the replica set. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-database-user-roles"> Database User Roles </a> for basic built-in roles to use in creating read-only and read-write users. </p> <p class="leafygreen-ui-1kp3ins"> You may also want additional administrative users. For more information on users, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-users/"> Users in Self-Managed Deployments <!-- --> . </a> </p> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> x.509 Internal Authentication <a class="headerlink leafygreen-ui-1kepx47" href="#x.509-internal-authentication" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="x.509-internal-authentication"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> For details on using x.509 for internal authentication, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-x509-member-authentication/"> Use x.509 Certificate for Membership Authentication with Self-Managed MongoDB <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To upgrade from keyfile internal authentication to x.509 internal authentication, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/upgrade-keyfile-to-x509/"> Upgrade Self-Managed MongoDB from Keyfile Authentication to x.509 Authentication <!-- --> . </a> </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/sh.addShardToZone/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> sh.addShardToZone() <a class="headerlink leafygreen-ui-1kepx47" href="#sh.addshardtozone--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sh.addshardtozone--"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#security" target="_self"> <span> Security </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> sh.addShardToZone(shard, zone) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-sh.addShardToZone" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-sh.addShardToZone"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Associates a shard with a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-zone"> zone </a> . MongoDB associates this shard with the given zone. Chunks that are covered by the zone are assigned to shards associated with the zone. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> mongosh Method </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page documents a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> method. This is <em> not </em> the documentation for database commands or language-specific drivers, such as Node.js. </p> <p class="leafygreen-ui-1kp3ins"> For the database command, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/addShardToZone/#mongodb-dbcommand-dbcmd.addShardToZone"> <code class="leafygreen-ui-1l06pbn"> addShardToZone </code> </a> command <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB API drivers, refer to the language-specific <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB driver documentation <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> This method has the following parameter: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-method-addShardToZone-shard" target="_self"> <span> shard </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-method-addShardToZone-shard"> </span> <p class="leafygreen-ui-1kp3ins"> The name of the shard to which to associate the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-method-addShardToZone-zone" target="_self"> <span> zone <!-- --> . </span> </a> </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-method-addShardToZone-zone" target="_self"> <span> zone </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-method-addShardToZone-zone"> </span> <p class="leafygreen-ui-1kp3ins"> The name of the zone to associate with the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-method-addShardToZone-shard" target="_self"> <span> shard <!-- --> . </span> </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> Only issue <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-sh.addShardToZone" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> sh.addShardToZone() </code> </span> </a> when connected to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This method is available in deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is not supported in serverless instances. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can associate a zone with multiple shards, and a shard can associate with multiple zones. </p> <p class="leafygreen-ui-1kp3ins"> See the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/zone-sharding/#std-label-zone-sharding"> zone </a> manual page for more information on zones in sharded clusters. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Ranges <a class="headerlink leafygreen-ui-1kepx47" href="#ranges" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="ranges"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB effectively ignores zones that do not have at least one range of shard key values associated with it. </p> <p class="leafygreen-ui-1kp3ins"> To associate a range of shard key values with a zone, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.updateZoneKeyRange/#mongodb-method-sh.updateZoneKeyRange"> <code class="leafygreen-ui-1l06pbn"> sh.updateZoneKeyRange() </code> </a> method. </p> <p class="leafygreen-ui-1kp3ins"> You can run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/updateZoneKeyRange/#mongodb-dbcommand-dbcmd.updateZoneKeyRange"> <code class="leafygreen-ui-1l06pbn"> updateZoneKeyRange </code> </a> database command and its helpers <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.updateZoneKeyRange/#mongodb-method-sh.updateZoneKeyRange"> <code class="leafygreen-ui-1l06pbn"> sh.updateZoneKeyRange() </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.addTagRange/#mongodb-method-sh.addTagRange"> <code class="leafygreen-ui-1l06pbn"> sh.addTagRange() </code> </a> on an unsharded collection or a non-existing collection. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> By defining the zones and the zone ranges <em> before </em> sharding an empty or a non-existing collection, the shard collection operation creates chunks for the defined zone ranges as well as any additional chunks to cover the entire range of the shard key values and performs an initial chunk distribution based on the zone ranges. This initial creation and distribution of chunks allows for faster setup of zoned sharding. After the initial distribution, the balancer manages the chunk distribution going forward. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.updateZoneKeyRange/#std-label-pre-define-zone-range-example"> Pre-Define Zones and Zone Ranges for an Empty or Non-Existing Collection </a> for an example. </p> </div> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Security <a class="headerlink leafygreen-ui-1kepx47" href="#security" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="security"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> For sharded clusters that enforce <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/enable-authentication/"> access control </a> , you must authenticate as a user whose privileges include either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-update"> <code class="leafygreen-ui-1l06pbn"> update </code> </a> on the <code class="leafygreen-ui-1l06pbn"> shards </code> collection in the <code class="leafygreen-ui-1l06pbn"> config </code> database; or, alternatively, </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-enableSharding"> <code class="leafygreen-ui-1l06pbn"> enableSharding </code> </a> on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/resource-document/#std-label-resource-specific-collection"> cluster </a> resource. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-clusterAdmin"> <code class="leafygreen-ui-1l06pbn"> clusterAdmin </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-clusterManager"> <code class="leafygreen-ui-1l06pbn"> clusterManager </code> </a> built-in roles have the appropriate permissions for issuing <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-sh.addShardToZone" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> sh.addShardToZone() </code> </span> </a> . See the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/#std-label-authorization"> Role-Based Access Control </a> manual page for more information. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example adds three zones, <code class="leafygreen-ui-1l06pbn"> NYC </code> , <code class="leafygreen-ui-1l06pbn"> LAX </code> , and <code class="leafygreen-ui-1l06pbn"> NRT </code> , associating each to a shard: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.addShardToZone(\"shard0000\", \"JFK\")\nsh.addShardToZone(\"shard0001\", \"LAX\")\nsh.addShardToZone(\"shard0002\", \"NRT\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShardToZone</span>(<span class="lg-highlight-string">"shard0000"</span>, <span class="lg-highlight-string">"JFK"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShardToZone</span>(<span class="lg-highlight-string">"shard0001"</span>, <span class="lg-highlight-string">"LAX"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShardToZone</span>(<span class="lg-highlight-string">"shard0002"</span>, <span class="lg-highlight-string">"NRT"</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> A shard can associate with multiple zones. The following example associates <code class="leafygreen-ui-1l06pbn"> LGA </code> to <code class="leafygreen-ui-1l06pbn"> shard0000 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.addShardToZone(\"shard0000\", \"LGA\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShardToZone</span>(<span class="lg-highlight-string">"shard0000"</span>, <span class="lg-highlight-string">"LGA"</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> shard0000 </code> associates with both the <code class="leafygreen-ui-1l06pbn"> LGA </code> zone and the <code class="leafygreen-ui-1l06pbn"> JFK </code> zone. In a balanced cluster, MongoDB routes reads and writes covered by either zone to <code class="leafygreen-ui-1l06pbn"> shard0000 </code> . </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.updateZoneKeyRange/#mongodb-method-sh.updateZoneKeyRange"> <code class="leafygreen-ui-1l06pbn"> sh.updateZoneKeyRange() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.removeShardFromZone/#mongodb-method-sh.removeShardFromZone"> <code class="leafygreen-ui-1l06pbn"> sh.removeShardFromZone() </code> </a> </p> </li> </ul> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/core/index-unique/convert-to-unique/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Convert an Existing Index to a Unique Index <a class="headerlink leafygreen-ui-1kepx47" href="#convert-an-existing-index-to-a-unique-index" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="convert-an-existing-index-to-a-unique-index"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#before-you-begin" target="_self"> <span> Before you Begin </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#steps" target="_self"> <span> Steps </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self"> <span> Learn More </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> To convert a non-unique index to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-unique/#std-label-index-type-unique"> unique index </a> , use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> command. The <code class="leafygreen-ui-1l06pbn"> collMod </code> command provides options to verify that your indexed field contains unique values before you complete the conversion. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Before you Begin <a class="headerlink leafygreen-ui-1kepx47" href="#before-you-begin" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="before-you-begin"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Create the apples collection:","name":"Populate sample data"},{"@type":"HowToStep","text":"Add a single field index on the type field:","name":"Create a single field index"}],"name":"Before you Begin","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Populate sample data <a class="headerlink leafygreen-ui-1kepx47" href="#populate-sample-data" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="populate-sample-data"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Create the <code class="leafygreen-ui-1l06pbn"> apples </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.apples.insertMany( [\n { type: \"Delicious\", quantity: 12 },\n { type: \"Macintosh\", quantity: 13 },\n { type: \"Delicious\", quantity: 13 },\n { type: \"Fuji\", quantity: 15 },\n { type: \"Washington\", quantity: 10 }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">apples</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Delicious"</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">12</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Macintosh"</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">13</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Delicious"</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">13</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Fuji"</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">15</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Washington"</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">10</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create a single field index <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-single-field-index" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-a-single-field-index"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Add a single field index on the <code class="leafygreen-ui-1l06pbn"> type </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.apples.createIndex( { type: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">apples</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Steps <a class="headerlink leafygreen-ui-1kepx47" href="#steps" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="steps"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Run collMod on the type field index and set\nprepareUnique to true:After prepareUnique is set, you cannot insert new documents\nthat duplicate an index key entry. For example, the following\ninsert operation results in an error:","name":"Prepare the index to be converted to a unique index"},{"@type":"HowToStep","text":"To see if there are any documents that violate the unique constraint on\nthe type field, run collMod with unique: true and dryRun:\ntrue:","name":"Check for unique key violations"},{"@type":"HowToStep","text":"To complete the conversion, modify the duplicate entries to remove any\nconflicts. For example:","name":"Resolve duplicate key conflicts"},{"@type":"HowToStep","text":"To confirm that the index can be converted, re-run the collMod()\ncommand with dryRun: true:","name":"Confirm that all conflicts are resolved"},{"@type":"HowToStep","text":"To finalize the conversion to a unique index, run the collMod\ncommand with unique: true and remove the dryRun flag:","name":"Finalize the index conversion"}],"name":"Steps","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Prepare the index to be converted to a unique index <a class="headerlink leafygreen-ui-1kepx47" href="#prepare-the-index-to-be-converted-to-a-unique-index" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="prepare-the-index-to-be-converted-to-a-unique-index"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Run <code class="leafygreen-ui-1l06pbn"> collMod </code> on the <code class="leafygreen-ui-1l06pbn"> type </code> field index and set <code class="leafygreen-ui-1l06pbn"> prepareUnique </code> to <code class="leafygreen-ui-1l06pbn"> true </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand( {\n collMod: \"apples\",\n index: {\n keyPattern: { type: 1 },\n prepareUnique: true\n }\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collMod</span>: <span class="lg-highlight-string">"apples"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">index</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">keyPattern</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">prepareUnique</span>: <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> After <code class="leafygreen-ui-1l06pbn"> prepareUnique </code> is set, you cannot insert new documents that duplicate an index key entry. For example, the following insert operation results in an error: </p> <div class="css-1f5771r"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.apples.insertOne( { type: \"Delicious\", quantity: 20 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">apples</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>( <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Delicious"</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">20</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="css-9st569 efa38qy0" style="--border-color:#E8EDEB"> <button aria-disabled="false" class="lg-ui-button-0000 leafygreen-ui-hix6y6" data-lgid="lg-button" role="button" type="button"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg alt="" aria-hidden="true" class="leafygreen-ui-hjnzs9" fill="none" height="16" role="presentation" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M14.364 10.778a1 1 0 0 0 0-1.414l-4.95-4.95-.707-.707a1 1 0 0 0-1.414 0l-.707.707-4.95 4.95a1 1 0 0 0 0 1.414l.707.707a1 1 0 0 0 1.414 0L8 7.243l4.243 4.242a1 1 0 0 0 1.414 0l.707-.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> HIDE OUTPUT </div> </button> </div> <div class="leafygreen-ui-1oteowz"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"MongoServerError: E11000 duplicate key error collection:\ntest.apples index: type_1 dup key: { type: \"Delicious\" }","programmingLanguage":"JavaScript"} </script> <div class="css-1sax7hu e11q6jfk0" style="--code-container-border:initial;--code-pre-border:none"> <div class="leafygreen-ui-1fyvhqe"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-12cejcz" tabindex="-1"><code class="lg-highlight-hljs-dark javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">MongoServerError</span>: <span class="lg-highlight-variable lg-highlight-constant">E11000</span> duplicate key error <span class="lg-highlight-attr">collection</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx">test.<span class="lg-highlight-property">apples</span> <span class="lg-highlight-attr">index</span>: <!-- -->type_1 dup <span class="lg-highlight-attr">key</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Delicious"</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Check for unique key violations <a class="headerlink leafygreen-ui-1kepx47" href="#check-for-unique-key-violations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="check-for-unique-key-violations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To see if there are any documents that violate the unique constraint on the <code class="leafygreen-ui-1l06pbn"> type </code> field, run <code class="leafygreen-ui-1l06pbn"> collMod </code> with <code class="leafygreen-ui-1l06pbn"> unique: true </code> and <code class="leafygreen-ui-1l06pbn"> dryRun: true </code> : </p> <div class="css-1f5771r"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand( {\n collMod: \"apples\",\n index: {\n keyPattern: { type: 1 },\n unique: true\n },\n dryRun: true\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collMod</span>: <span class="lg-highlight-string">"apples"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">index</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">keyPattern</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">unique</span>: <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dryRun</span>: <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="css-9st569 efa38qy0" style="--border-color:#E8EDEB"> <button aria-disabled="false" class="lg-ui-button-0000 leafygreen-ui-hix6y6" data-lgid="lg-button" role="button" type="button"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg alt="" aria-hidden="true" class="leafygreen-ui-hjnzs9" fill="none" height="16" role="presentation" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M14.364 10.778a1 1 0 0 0 0-1.414l-4.95-4.95-.707-.707a1 1 0 0 0-1.414 0l-.707.707-4.95 4.95a1 1 0 0 0 0 1.414l.707.707a1 1 0 0 0 1.414 0L8 7.243l4.243 4.242a1 1 0 0 0 1.414 0l.707-.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> HIDE OUTPUT </div> </button> </div> <div class="leafygreen-ui-1oteowz"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"MongoServerError: Cannot convert the index to unique. Please resolve conflicting documents before running collMod again.\n\nViolations: [\n {\n ids: [\n ObjectId(\"660489d24cabd75abebadbd0\"),\n ObjectId(\"660489d24cabd75abebadbd2\")\n ]\n }\n]","programmingLanguage":"JavaScript"} </script> <div class="css-1sax7hu e11q6jfk0" style="--code-container-border:initial;--code-pre-border:none"> <div class="leafygreen-ui-1fyvhqe"> <div class="leafygreen-ui-1ij019s"> <pre class="leafygreen-ui-12cejcz" tabindex="0"><code class="lg-highlight-hljs-dark javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">MongoServerError</span>: <span class="lg-highlight-title lg-highlight-class">Cannot</span> convert the index to unique. <span class="lg-highlight-title lg-highlight-class">Please</span> resolve conflicting documents before running collMod again.</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">Violations</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">ids</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"660489d24cabd75abebadbd0"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"660489d24cabd75abebadbd2"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Resolve duplicate key conflicts <a class="headerlink leafygreen-ui-1kepx47" href="#resolve-duplicate-key-conflicts" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="resolve-duplicate-key-conflicts"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To complete the conversion, modify the duplicate entries to remove any conflicts. For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.apples.deleteOne(\n { _id: ObjectId(\"660489d24cabd75abebadbd2\") }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">apples</span>.<span class="lg-highlight-title lg-highlight-function">deleteOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"660489d24cabd75abebadbd2"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Confirm that all conflicts are resolved <a class="headerlink leafygreen-ui-1kepx47" href="#confirm-that-all-conflicts-are-resolved" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="confirm-that-all-conflicts-are-resolved"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To confirm that the index can be converted, re-run the <code class="leafygreen-ui-1l06pbn"> collMod() </code> command with <code class="leafygreen-ui-1l06pbn"> dryRun: true </code> : </p> <div class="css-1f5771r"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand( {\n collMod: \"apples\",\n index: {\n keyPattern: { type: 1 },\n unique: true\n },\n dryRun: true\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collMod</span>: <span class="lg-highlight-string">"apples"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">index</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">keyPattern</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">unique</span>: <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dryRun</span>: <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="css-9st569 efa38qy0" style="--border-color:#E8EDEB"> <button aria-disabled="false" class="lg-ui-button-0000 leafygreen-ui-hix6y6" data-lgid="lg-button" role="button" type="button"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg alt="" aria-hidden="true" class="leafygreen-ui-hjnzs9" fill="none" height="16" role="presentation" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M14.364 10.778a1 1 0 0 0 0-1.414l-4.95-4.95-.707-.707a1 1 0 0 0-1.414 0l-.707.707-4.95 4.95a1 1 0 0 0 0 1.414l.707.707a1 1 0 0 0 1.414 0L8 7.243l4.243 4.242a1 1 0 0 0 1.414 0l.707-.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> HIDE OUTPUT </div> </button> </div> <div class="leafygreen-ui-1oteowz"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ ok: 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-1sax7hu e11q6jfk0" style="--code-container-border:initial;--code-pre-border:none"> <div class="leafygreen-ui-1fyvhqe"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1qhgg7e" tabindex="-1"><code class="lg-highlight-hljs-dark javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">ok</span>: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Finalize the index conversion <a class="headerlink leafygreen-ui-1kepx47" href="#finalize-the-index-conversion" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="finalize-the-index-conversion"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To finalize the conversion to a unique index, run the <code class="leafygreen-ui-1l06pbn"> collMod </code> command with <code class="leafygreen-ui-1l06pbn"> unique: true </code> and remove the <code class="leafygreen-ui-1l06pbn"> dryRun </code> flag: </p> <div class="css-1f5771r"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand( {\n collMod: \"apples\",\n index: {\n keyPattern: { type: 1 },\n unique: true\n }\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collMod</span>: <span class="lg-highlight-string">"apples"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">index</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">keyPattern</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">unique</span>: <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="css-9st569 efa38qy0" style="--border-color:#E8EDEB"> <button aria-disabled="false" class="lg-ui-button-0000 leafygreen-ui-hix6y6" data-lgid="lg-button" role="button" type="button"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg alt="" aria-hidden="true" class="leafygreen-ui-hjnzs9" fill="none" height="16" role="presentation" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M14.364 10.778a1 1 0 0 0 0-1.414l-4.95-4.95-.707-.707a1 1 0 0 0-1.414 0l-.707.707-4.95 4.95a1 1 0 0 0 0 1.414l.707.707a1 1 0 0 0 1.414 0L8 7.243l4.243 4.242a1 1 0 0 0 1.414 0l.707-.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> HIDE OUTPUT </div> </button> </div> <div class="leafygreen-ui-1oteowz"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ unique_new: true, ok: 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-1sax7hu e11q6jfk0" style="--code-container-border:initial;--code-pre-border:none"> <div class="leafygreen-ui-1fyvhqe"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1qhgg7e" tabindex="-1"><code class="lg-highlight-hljs-dark javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">unique_new</span>: <span class="lg-highlight-literal">true</span>, <span class="lg-highlight-attr">ok</span>: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-indexes/#std-label-manage-indexes"> Manage Indexes </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-properties/#std-label-index-properties"> Index Properties </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/applications/indexes/#std-label-indexing-strategies"> Indexing Strategies </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/release-notes/6.0-upgrade-sharded-cluster/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Upgrade a Sharded Cluster to 6.0 <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-a-sharded-cluster-to-6.0" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upgrade-a-sharded-cluster-to-6.0"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#upgrade-recommendations-and-checklists" target="_self"> <span> Upgrade Recommendations and Checklists </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#prerequisites" target="_self"> <span> Prerequisites </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#download-newversion-binaries" target="_self"> <span> Download <!-- --> 6.0 <!-- --> Binaries </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#upgrade-procedure" target="_self"> <span> Upgrade Procedure </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#additional-upgrade-procedures" target="_self"> <span> Additional Upgrade Procedures </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> Use this tutorial to upgrade from MongoDB <!-- --> 5.0 <!-- --> to MongoDB <!-- --> 6.0 <!-- --> . To upgrade to a new patch release within the same release series, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/upgrade-revision/#std-label-upgrade-to-latest-revision"> Upgrade to the Latest Self-Managed Patch Release of MongoDB <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Familiarize yourself with the content of this document, including thoroughly reviewing the prerequisites, prior to upgrading to MongoDB <!-- --> 6.0 <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> The following steps outline the procedure to upgrade a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> that is a shard member from version <!-- --> 5.0 <!-- --> to <!-- --> 6.0 <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> If you need guidance on upgrading to <!-- --> 6.0 <!-- --> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/products/consulting?tck=docs_server" target="_self"> <span> MongoDB professional services </span> </a> offer major version upgrade support to help ensure a smooth transition without interruption to your MongoDB application. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Upgrade Recommendations and Checklists <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-recommendations-and-checklists" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upgrade-recommendations-and-checklists"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> When upgrading, consider the following: </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Upgrade Version Path <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-version-path" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upgrade-version-path"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To upgrade an existing MongoDB deployment to <!-- --> 6.0 <!-- --> , you must be running a <!-- --> 5.0-series <!-- --> release. </p> <p class="leafygreen-ui-1kp3ins"> To upgrade from a version earlier than the <!-- --> 5.0-series <!-- --> , you must successively upgrade major releases until you have upgraded to <!-- --> 5.0-series <!-- --> . For example, if you are running a <!-- --> 4.4-series <!-- --> , you must <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/5.0/#std-label-5.0-upgrade"> upgrade first to 5.0 </a> <em> before </em> you can upgrade to <!-- --> 6.0 <!-- --> . </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Check Driver Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#check-driver-compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="check-driver-compatibility"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Before you upgrade MongoDB, check that you're using a MongoDB <!-- --> 6.0 <!-- --> -compatible driver. Consult the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> driver documentation </span> </a> for your specific driver to verify compatibility with MongoDB <!-- --> 6.0 <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> Upgraded deployments that run on incompatible drivers might encounter unexpected or undefined behavior. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Preparedness <a class="headerlink leafygreen-ui-1kepx47" href="#preparedness" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="preparedness"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Before beginning your upgrade, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/6.0-compatibility/"> Compatibility Changes in MongoDB 6.0 </a> document to ensure that your applications and deployments are compatible with MongoDB <!-- --> 6.0 <!-- --> . Resolve the incompatibilities in your deployment before starting the upgrade. </p> <p class="leafygreen-ui-1kp3ins"> Before upgrading MongoDB, always test your application in a staging environment before deploying the upgrade to your production environment. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Downgrade Consideration <a class="headerlink leafygreen-ui-1kepx47" href="#downgrade-consideration" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="downgrade-consideration"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You cannot downgrade your deployment's binary version without assistance from support. </p> <p class="leafygreen-ui-1kp3ins"> To learn more, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/8.0-downgrade/#std-label-8.0-downgrade"> Downgrade <!-- --> 8.0 <!-- --> to <!-- --> 7.0 <!-- --> . </a> </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Prerequisites <a class="headerlink leafygreen-ui-1kepx47" href="#prerequisites" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="prerequisites"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> All Members Version <a class="headerlink leafygreen-ui-1kepx47" href="#all-members-version" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="all-members-version"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To upgrade a sharded cluster to <!-- --> 6.0 <!-- --> , <strong> all </strong> members of the cluster must be at least version <!-- --> 5.0 <!-- --> . The upgrade process checks all components of the cluster and will produce warnings if any component is running version earlier than <!-- --> 5.0 <!-- --> . </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Feature Compatibility Version <a class="headerlink leafygreen-ui-1kepx47" href="#feature-compatibility-version" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="feature-compatibility-version"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <!-- --> 5.0 <!-- --> sharded cluster must have <code class="leafygreen-ui-1l06pbn"> featureCompatibilityVersion </code> set to <code class="leafygreen-ui-1l06pbn"> "5.0" </code> . </p> <p class="leafygreen-ui-1kp3ins"> To ensure that all members of the sharded cluster have <code class="leafygreen-ui-1l06pbn"> featureCompatibilityVersion </code> set to <code class="leafygreen-ui-1l06pbn"> "5.0" </code> , connect to each shard replica set member and each config server replica set member and check the <code class="leafygreen-ui-1l06pbn"> featureCompatibilityVersion </code> : </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For a sharded cluster that has access control enabled, to run the following command against a shard replica set member, you must connect to the member as a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-users/#std-label-shard-local-users"> shard local user <!-- --> . </a> </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">getParameter</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">featureCompatibilityVersion</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> All members should return a result that includes <code class="leafygreen-ui-1l06pbn"> "featureCompatibilityVersion" : { "version" : "5.0" } </code> . </p> <p class="leafygreen-ui-1kp3ins"> To set or update <code class="leafygreen-ui-1l06pbn"> featureCompatibilityVersion </code> , run the following command on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { setFeatureCompatibilityVersion: \"5.0\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">setFeatureCompatibilityVersion</span>: <span class="lg-highlight-string">"5.0"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#mongodb-dbcommand-dbcmd.setFeatureCompatibilityVersion"> <code class="leafygreen-ui-1l06pbn"> setFeatureCompatibilityVersion </code> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Replica Set Member State <a class="headerlink leafygreen-ui-1kepx47" href="#replica-set-member-state" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="replica-set-member-state"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> For shards and config servers, ensure that no replica set member is in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-states/#mongodb-replstate-replstate.ROLLBACK"> <code class="leafygreen-ui-1l06pbn"> ROLLBACK </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-states/#mongodb-replstate-replstate.RECOVERING"> <code class="leafygreen-ui-1l06pbn"> RECOVERING </code> </a> state. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Back up the <code class="leafygreen-ui-1l06pbn"> config </code> Database <a class="headerlink leafygreen-ui-1kepx47" href="#back-up-the-config-database" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="back-up-the-config-database"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <em> Optional but Recommended. </em> As a precaution, take a backup of the <code class="leafygreen-ui-1l06pbn"> config </code> database <em> before </em> upgrading the sharded cluster. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Download <!-- --> 6.0 <!-- --> Binaries <a class="headerlink leafygreen-ui-1kepx47" href="#download-newversion-binaries" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="download-newversion-binaries"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use Package Manager <a class="headerlink leafygreen-ui-1kepx47" href="#use-package-manager" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-package-manager"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you installed MongoDB from the MongoDB <code class="leafygreen-ui-1l06pbn"> apt </code> , <code class="leafygreen-ui-1l06pbn"> yum </code> , <code class="leafygreen-ui-1l06pbn"> dnf </code> , or <code class="leafygreen-ui-1l06pbn"> zypper </code> repositories, you should upgrade to <!-- --> 6.0 <!-- --> using your package manager. </p> <p class="leafygreen-ui-1kp3ins"> Follow the appropriate <a class="leafygreen-ui-tqgtui" href="/docs/manual/installation/#std-label-tutorial-installation"> 6.0 installation instructions </a> for your Linux system. This will involve adding a repository for the new release, then performing the actual upgrade process. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Download <!-- --> 6.0 <!-- --> Binaries Manually <a class="headerlink leafygreen-ui-1kepx47" href="#download-newversion-binaries-manually" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="download-newversion-binaries-manually"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you have not installed MongoDB using a package manager, you can manually download the MongoDB binaries from the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/try/download?tck=docs_server" target="_self"> <span> MongoDB Download Center </span> </a> . </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/installation/#std-label-tutorial-installation"> 6.0 installation instructions </a> for more information. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Upgrade Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-procedure" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upgrade-procedure"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Connect mongosh to a mongos instance\nin the sharded cluster, and run sh.stopBalancer() to\ndisable the balancer:If a migration is in progress, the system will complete the\nin-progress migration before stopping the balancer. You can run\nsh.isBalancerRunning() to check the balancer's current\nstate.To verify that the balancer is disabled, run\nsh.getBalancerState(), which returns false if the\nbalancer is disabled:For more information on disabling the balancer, see\nDisable the Balancer.","name":"Disable the Balancer."},{"@type":"HowToStep","text":"For each mongos in the cluster, connect\nmongosh to the mongos instance and run\nflushRouterConfig to refresh the cached routing table:","name":"Refresh the cached routing table for each mongos."},{"@type":"HowToStep","text":"Upgrade the secondary members of the replica set, one at a time.Shut down the secondary instance.To shut down the mongod process, use\nmongosh to connect to the cluster member and\nrun the following command:Replace the 5.0 binary with the 6.0 binary.Start the 6.0 binary.Start the 6.0 binary with the --configsvr,\n--replSet, and --port.\nInclude any other options as used by the deployment.If using a configuration file, update the file to\nspecify sharding.clusterRole: configsvr, replication.replSetName,\nnet.port, and net.bindIp,\nthen start the 6.0 binary:Include any other settings as appropriate for your deployment.Wait for the member to recover to the SECONDARY state before upgrading the next secondary member.To check the member's state, issue rs.status() in\nmongosh.Repeat for each secondary member.Step down the replica set primary.Step down the primary.Connect mongosh to the primary and use\nrs.stepDown() to step down the primary and force an\nelection of a new primary:Shut down the stepped-down primary.When rs.status() shows that the primary has stepped\ndown and another member has assumed the PRIMARY state, shut\ndown the stepped-down primary.To shut down the stepped-down primary, use\nmongosh to connect to the primary and\nrun the following command:Replace the mongod binary with the 6.0 binary.Start the 6.0 binary.Start the 6.0 with the --configsvr,\n--replSet,\n--port, and --bind_ip options. Include any optional command line\noptions used by the previous deployment:If using a configuration file, update the file to\nspecify sharding.clusterRole: configsvr, replication.replSetName,\nnet.port, and net.bindIp,\nthen start the 6.0 binary:Include any other configuration as appropriate for your deployment.","name":"Upgrade the config servers."},{"@type":"HowToStep","text":"Upgrade the shards one at a time.For each shard replica set, upgrade the secondary members of the replica set, one at a time:Shut down the secondary instance.To shut down the mongod process, use\nmongosh to connect to the cluster member and\nrun the following command:Replace the 5.0 binary with the 6.0 binary.Start the 6.0 binary with the --shardsvr, --replSet,\n--port, and --bind_ip options. Include any additional command line\noptions as appropriate for your deployment:If using a configuration file, update the file to\ninclude sharding.clusterRole: shardsvr,\nreplication.replSetName, net.port, and\nnet.bindIp, then start the 6.0 binary:Include any other configuration as appropriate for your deployment.Wait for the member to recover to the SECONDARY state before upgrading the next secondary member.To check the member's state, you can issue\nrs.status() in mongosh.Repeat for each secondary member.Step down the replica set primary.Connect mongosh to the primary and use\nrs.stepDown() to step down the primary and force an\nelection of a new primary:Upgrade the stepped-down primary.When rs.status() shows that the primary has\nstepped down and another member has assumed the PRIMARY\nstate, upgrade the stepped-down primary:Shut down the stepped-down primary.To shut down the stepped-down primary, use\nmongosh to connect to the replica set\nmember and run the following command:Replace the mongod binary with the 6.0 binary.Start the 6.0 binary.Start the 6.0 binary with the --shardsvr,\n--replSet,\n--port, and --bind_ip options. Include any additional command line\noptions as appropriate for your deployment:If using a configuration file, update the file to\nspecify sharding.clusterRole: shardsvr, replication.replSetName,\nnet.port, and net.bindIp, then start the\n6.0 binary:Include any other configuration as appropriate for your deployment.","name":"Upgrade the shards."},{"@type":"HowToStep","text":"Replace each mongos instance with the 6.0 binary\nand restart. Include any other configuration as appropriate for your\ndeployment.The --bind_ip option must be specified when\nthe sharded cluster members are run on different hosts or if\nremote clients connect to the sharded cluster.","name":"Upgrade the mongos instances."},{"@type":"HowToStep","text":"Using mongosh, connect to a\nmongos in the cluster and run\nsh.startBalancer() to re-enable the balancer:Starting in MongoDB 6.0.3, automatic chunk splitting is not performed.\nThis is because of balancing policy improvements. Auto-splitting commands\nstill exist, but do not perform an operation.In MongoDB versions earlier than 6.0.3, sh.startBalancer()\nalso enables auto-splitting for the sharded cluster.If you do not wish to enable auto-splitting while the balancer is\nenabled, you must also run sh.disableAutoSplit().For more information about re-enabling the balancer, see\nEnable the Balancer.","name":"Re-enable the balancer."},{"@type":"HowToStep","text":"At this point, you can run the 6.0 binaries without the\n6.0 features that are incompatible with 5.0.To enable these 6.0 features, set the feature compatibility\nversion (fCV) to 6.0.Enabling these backwards-incompatible features can complicate the\ndowngrade process since you must remove any persisted backwards-incompatible\nfeatures before you downgrade.It is recommended that after upgrading, you allow your deployment to run\nwithout enabling these features for a burn-in period to ensure the\nlikelihood of downgrade is minimal. When you are confident that the\nlikelihood of downgrade is minimal, enable these features.On a mongos instance, run the\nsetFeatureCompatibilityVersion command in the admin\ndatabase:Setting featureCompatibilityVersion (fCV) : \"6.0\"\nimplicitly performs a replSetReconfig on each shard to\nadd the term field to the shard replica configuration\ndocument.The command doesn't complete until the new configuration propagates to a\nmajority of replica set members.This command must perform writes to an internal system collection.\nIf for any reason the command does not complete successfully, you\ncan safely retry the command on the mongos as the\noperation is idempotent.While setFeatureCompatibilityVersion is running on\nthe sharded cluster, chunk migrations, splits, and merges\ncan fail with ConflictingOperationInProgress.Any orphaned documents that exist on your\nshards will be cleaned up when you set the\nsetFeatureCompatibilityVersion to 6.0. The\ncleanup process:Does not block the upgrade from completing, andIs rate limited. To mitigate the potential effect on performance\nduring orphaned document cleanup, see\nRange Deletion Performance Tuning.The mongos binary cannot connect to mongod\ninstances whose feature compatibility version (fCV) is greater\nthan that of the mongos. For example, you cannot connect\na MongoDB 5.0 version mongos to a 6.0\nsharded cluster with fCV set to 6.0. You\ncan, however, connect a MongoDB 5.0 version\nmongos to a 6.0 sharded cluster with fCV set to 5.0.Using substitutions, so that the blurb in example is updated per each version of the manual.","name":"Enable backwards-incompatible 6.0 features."}],"name":"Upgrade Procedure","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Disable the Balancer. <a class="headerlink leafygreen-ui-1kepx47" href="#disable-the-balancer." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="disable-the-balancer."> </div> </a> </h3> <span class="leafygreen-ui-1qnjd6d" id="std-label-6.0-upgrade-disable-balancer"> </span> <p class="leafygreen-ui-1kp3ins"> Connect <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance in the sharded cluster, and run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.stopBalancer/#mongodb-method-sh.stopBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.stopBalancer() </code> </a> to disable the balancer: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.stopBalancer()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">stopBalancer</span>(<!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If a migration is in progress, the system will complete the in-progress migration before stopping the balancer. You can run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.isBalancerRunning/#mongodb-method-sh.isBalancerRunning"> <code class="leafygreen-ui-1l06pbn"> sh.isBalancerRunning() </code> </a> to check the balancer's current state. </p> <p class="leafygreen-ui-1kp3ins"> To verify that the balancer is disabled, run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.getBalancerState/#mongodb-method-sh.getBalancerState"> <code class="leafygreen-ui-1l06pbn"> sh.getBalancerState() </code> </a> , which returns false if the balancer is disabled: </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.getBalancerState()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">getBalancerState</span>(<!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on disabling the balancer, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-sharded-cluster-balancer/#std-label-sharding-balancing-disable-temporarily"> Disable the Balancer <!-- --> . </a> </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Refresh the cached routing table for each <code class="leafygreen-ui-1l06pbn"> mongos </code> . <a class="headerlink leafygreen-ui-1kepx47" href="#refresh-the-cached-routing-table-for-each-mongos." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="refresh-the-cached-routing-table-for-each-mongos."> </div> </a> </h3> <span class="leafygreen-ui-1qnjd6d" id="std-label-6.0-upgrade-refresh-cached-routing-table"> </span> <p class="leafygreen-ui-1kp3ins"> For each <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> in the cluster, connect <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to the <code class="leafygreen-ui-1l06pbn"> mongos </code> instance and run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/flushRouterConfig/#mongodb-dbcommand-dbcmd.flushRouterConfig"> <code class="leafygreen-ui-1l06pbn"> flushRouterConfig </code> </a> to refresh the cached routing table: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand(\"flushRouterConfig\")\ndb.adminCommand(\n {\n flushRouterConfig: 1\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>(<span class="lg-highlight-string">"flushRouterConfig"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">flushRouterConfig</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Upgrade the config servers. <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-the-config-servers." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upgrade-the-config-servers."> </div> </a> </h3> <span class="leafygreen-ui-1qnjd6d" id="std-label-6.0-upgrade-config-servers"> </span> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Upgrade the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-members/#std-label-replica-set-secondary-members"> secondary </a> members of the replica set, one at a time. </p> <ol class="leafygreen-ui-rioki0" type="i"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Shut down the secondary instance. </p> <p class="leafygreen-ui-1kp3ins"> To shut down the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process, use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to connect to the cluster member and run the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { shutdown: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">shutdown</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Replace the <!-- --> 5.0 <!-- --> binary with the <!-- --> 6.0 <!-- --> binary. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Start the <!-- --> 6.0 <!-- --> binary. </p> <p class="leafygreen-ui-1kp3ins"> Start the <!-- --> 6.0 <!-- --> binary with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--configsvr"> <code class="leafygreen-ui-1l06pbn"> --configsvr </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--replSet"> <code class="leafygreen-ui-1l06pbn"> --replSet </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--port"> <code class="leafygreen-ui-1l06pbn"> --port </code> </a> . Include any other options as used by the deployment. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --configsvr --replSet &lt;replsetname&gt; --port &lt;port&gt; --dbpath &lt;path&gt; --bind_ip localhost,&lt;ip&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --configsvr --replSet &lt;replSetName&gt; --port &lt;port&gt; --dbpath &lt;path&gt; --bind_ip localhost,&lt;ip address&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If using a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/"> configuration file </a> , update the file to specify <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-sharding.clusterRole"> <code class="leafygreen-ui-1l06pbn"> sharding.clusterRole: configsvr </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.port"> <code class="leafygreen-ui-1l06pbn"> net.port </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> , then start the <!-- --> 6.0 <!-- --> binary: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sharding:\n clusterRole: configsvr\nreplication:\n replSetName: &lt;string&gt;\nnet:\n port: &lt;port&gt;\n bindIp: localhost,&lt;ip&gt;\nstorage:\n dbpath: &lt;path&gt;","programmingLanguage":"YAML"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light yaml leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">sharding:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">clusterRole:</span> <span class="lg-highlight-string">configsvr</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">replication:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">replSetName:</span> <span class="lg-highlight-string">&lt;string&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">net:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">port:</span> <span class="lg-highlight-string">&lt;port&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bindIp:</span> <span class="lg-highlight-string">localhost,&lt;ip</span> <span class="lg-highlight-string">address&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">storage:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dbpath:</span> <span class="lg-highlight-string">&lt;path&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include any other settings as appropriate for your deployment. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Wait for the member to recover to the <code class="leafygreen-ui-1l06pbn"> SECONDARY </code> state before upgrading the next secondary member. </p> <p class="leafygreen-ui-1kp3ins"> To check the member's state, issue <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Repeat for each secondary member. </p> </li> </ol> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Step down the replica set primary. </p> <ol class="leafygreen-ui-rioki0" type="i"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Step down the primary. </p> <p class="leafygreen-ui-1kp3ins"> Connect <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to the primary and use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.stepDown/#mongodb-method-rs.stepDown"> <code class="leafygreen-ui-1l06pbn"> rs.stepDown() </code> </a> to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-step-down"> step down </a> the primary and force an election of a new primary: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"rs.stepDown()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">stepDown</span>(<!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Shut down the stepped-down primary. </p> <p class="leafygreen-ui-1kp3ins"> When <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> shows that the primary has stepped down and another member has assumed the <code class="leafygreen-ui-1l06pbn"> PRIMARY </code> state, shut down the stepped-down primary. </p> <p class="leafygreen-ui-1kp3ins"> To shut down the stepped-down primary, use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to connect to the primary and run the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { shutdown: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">shutdown</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Replace the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> binary with the <!-- --> 6.0 <!-- --> binary. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Start the <!-- --> 6.0 <!-- --> binary. </p> <p class="leafygreen-ui-1kp3ins"> Start the <!-- --> 6.0 <!-- --> with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--configsvr"> <code class="leafygreen-ui-1l06pbn"> --configsvr </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--replSet"> <code class="leafygreen-ui-1l06pbn"> --replSet </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--port"> <code class="leafygreen-ui-1l06pbn"> --port </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--bind_ip"> <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> </a> options. Include any optional command line options used by the previous deployment: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --configsvr --replSet &lt;replsetname&gt; --port &lt;port&gt; --dbpath &lt;path&gt; --bind_ip localhost,&lt;ip&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --configsvr --replSet &lt;replSetName&gt; --port &lt;port&gt; --dbpath &lt;path&gt; --bind_ip localhost,&lt;ip address&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If using a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/"> configuration file </a> , update the file to specify <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-sharding.clusterRole"> <code class="leafygreen-ui-1l06pbn"> sharding.clusterRole: configsvr </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.port"> <code class="leafygreen-ui-1l06pbn"> net.port </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> , then start the <!-- --> 6.0 <!-- --> binary: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sharding:\n clusterRole: configsvr\nreplication:\n replSetName: &lt;string&gt;\nnet:\n port: &lt;port&gt;\n bindIp: localhost,&lt;ip&gt;\nstorage:\n dbpath: &lt;path&gt;","programmingLanguage":"YAML"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light yaml leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">sharding:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">clusterRole:</span> <span class="lg-highlight-string">configsvr</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">replication:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">replSetName:</span> <span class="lg-highlight-string">&lt;string&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">net:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">port:</span> <span class="lg-highlight-string">&lt;port&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bindIp:</span> <span class="lg-highlight-string">localhost,&lt;ip</span> <span class="lg-highlight-string">address&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">storage:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dbpath:</span> <span class="lg-highlight-string">&lt;path&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include any other configuration as appropriate for your deployment. </p> </li> </ol> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Upgrade the shards. <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-the-shards." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upgrade-the-shards."> </div> </a> </h3> <span class="leafygreen-ui-1qnjd6d" id="std-label-6.0-upgrade-shards"> </span> <p class="leafygreen-ui-1kp3ins"> Upgrade the shards one at a time. </p> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For each shard replica set, upgrade the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-members/#std-label-replica-set-secondary-members"> secondary </a> members of the replica set, one at a time: </p> <ol class="leafygreen-ui-rioki0" type="i"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Shut down the secondary instance. </p> <p class="leafygreen-ui-1kp3ins"> To shut down the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process, use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to connect to the cluster member and run the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { shutdown: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">shutdown</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Replace the <!-- --> 5.0 <!-- --> binary with the <!-- --> 6.0 <!-- --> binary. </p> <p class="leafygreen-ui-1kp3ins"> Start the <!-- --> 6.0 <!-- --> binary with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--shardsvr"> <code class="leafygreen-ui-1l06pbn"> --shardsvr </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--replSet"> <code class="leafygreen-ui-1l06pbn"> --replSet </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--port"> <code class="leafygreen-ui-1l06pbn"> --port </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--bind_ip"> <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> </a> options. Include any additional command line options as appropriate for your deployment: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --shardsvr --replSet &lt;replsetname&gt; --port &lt;port&gt; --dbpath &lt;path&gt; --bind_ip localhost,&lt;ip&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --shardsvr --replSet &lt;replSetName&gt; --port &lt;port&gt; --dbpath &lt;path&gt; --bind_ip localhost,&lt;ip address&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If using a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/"> configuration file </a> , update the file to include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-sharding.clusterRole"> <code class="leafygreen-ui-1l06pbn"> sharding.clusterRole: shardsvr </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.port"> <code class="leafygreen-ui-1l06pbn"> net.port </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> , then start the <!-- --> 6.0 <!-- --> binary: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sharding:\n clusterRole: shardsvr\nreplication:\n replSetName: &lt;string&gt;\nnet:\n port: &lt;port&gt;\n bindIp: localhost,&lt;ip&gt;\nstorage:\n dbpath: &lt;path&gt;","programmingLanguage":"YAML"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light yaml leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">sharding:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">clusterRole:</span> <span class="lg-highlight-string">shardsvr</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">replication:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">replSetName:</span> <span class="lg-highlight-string">&lt;string&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">net:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">port:</span> <span class="lg-highlight-string">&lt;port&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bindIp:</span> <span class="lg-highlight-string">localhost,&lt;ip</span> <span class="lg-highlight-string">address&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">storage:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dbpath:</span> <span class="lg-highlight-string">&lt;path&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include any other configuration as appropriate for your deployment. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Wait for the member to recover to the <code class="leafygreen-ui-1l06pbn"> SECONDARY </code> state before upgrading the next secondary member. </p> <p class="leafygreen-ui-1kp3ins"> To check the member's state, you can issue <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Repeat for each secondary member. </p> </li> </ol> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Step down the replica set primary. </p> <p class="leafygreen-ui-1kp3ins"> Connect <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to the primary and use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.stepDown/#mongodb-method-rs.stepDown"> <code class="leafygreen-ui-1l06pbn"> rs.stepDown() </code> </a> to step down the primary and force an election of a new primary: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"rs.stepDown()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">stepDown</span>(<!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Upgrade the stepped-down primary. </p> <p class="leafygreen-ui-1kp3ins"> When <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> shows that the primary has stepped down and another member has assumed the <code class="leafygreen-ui-1l06pbn"> PRIMARY </code> state, upgrade the stepped-down primary: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Shut down the stepped-down primary. </p> <p class="leafygreen-ui-1kp3ins"> To shut down the stepped-down primary, use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to connect to the replica set member and run the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { shutdown: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">shutdown</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Replace the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> binary with the <!-- --> 6.0 <!-- --> binary. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Start the 6.0 binary. </p> <p class="leafygreen-ui-1kp3ins"> Start the <!-- --> 6.0 <!-- --> binary with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--shardsvr"> <code class="leafygreen-ui-1l06pbn"> --shardsvr </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--replSet"> <code class="leafygreen-ui-1l06pbn"> --replSet </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--port"> <code class="leafygreen-ui-1l06pbn"> --port </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--bind_ip"> <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> </a> options. Include any additional command line options as appropriate for your deployment: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --shardsvr --replSet &lt;replsetname&gt; --port &lt;port&gt; --dbpath &lt;path&gt; --bind_ip localhost,&lt;ip&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --shardsvr --replSet &lt;replSetName&gt; --port &lt;port&gt; --dbpath &lt;path&gt; --bind_ip localhost,&lt;ip address&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If using a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/"> configuration file </a> , update the file to specify <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-sharding.clusterRole"> <code class="leafygreen-ui-1l06pbn"> sharding.clusterRole: shardsvr </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.port"> <code class="leafygreen-ui-1l06pbn"> net.port </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> , then start the <!-- --> 6.0 <!-- --> binary: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sharding:\n clusterRole: shardsvr\nreplication:\n replSetName: &lt;string&gt;\nnet:\n port: &lt;port&gt;\n bindIp: localhost,&lt;ip&gt;\nstorage:\n dbpath: &lt;path&gt;","programmingLanguage":"YAML"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light yaml leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">sharding:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">clusterRole:</span> <span class="lg-highlight-string">shardsvr</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">replication:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">replSetName:</span> <span class="lg-highlight-string">&lt;string&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">net:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">port:</span> <span class="lg-highlight-string">&lt;port&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bindIp:</span> <span class="lg-highlight-string">localhost,&lt;ip</span> <span class="lg-highlight-string">address&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">storage:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dbpath:</span> <span class="lg-highlight-string">&lt;path&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include any other configuration as appropriate for your deployment. </p> </li> </ol> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Upgrade the <code class="leafygreen-ui-1l06pbn"> mongos </code> instances. <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-the-mongos-instances." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upgrade-the-mongos-instances."> </div> </a> </h3> <span class="leafygreen-ui-1qnjd6d" id="std-label-6.0-upgrade-mongos-instances"> </span> <p class="leafygreen-ui-1kp3ins"> Replace each <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance with the <!-- --> 6.0 <!-- --> binary and restart. Include any other configuration as appropriate for your deployment. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--bind_ip"> <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> </a> option must be specified when the sharded cluster members are run on different hosts or if remote clients connect to the sharded cluster. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongos --configdb csReplSet/&lt;rsconfigsver1:port1&gt;,&lt;rsconfigsver2:port2&gt;,&lt;rsconfigsver3:port3&gt; --bind_ip localhost,&lt;ip&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongos --configdb csReplSet/&lt;rsconfigsver1:port1&gt;,&lt;rsconfigsver2:port2&gt;,&lt;rsconfigsver3:port3&gt; --bind_ip localhost,&lt;ip address&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 6 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Re-enable the balancer. <a class="headerlink leafygreen-ui-1kepx47" href="#re-enable-the-balancer." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="re-enable-the-balancer."> </div> </a> </h3> <span class="leafygreen-ui-1qnjd6d" id="std-label-6.0-upgrade-reenable-balancer"> </span> <p class="leafygreen-ui-1kp3ins"> Using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , connect to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> in the cluster and run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.startBalancer/#mongodb-method-sh.startBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.startBalancer() </code> </a> to re-enable the balancer: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.startBalancer()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">startBalancer</span>(<!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 6.0.3, automatic chunk splitting is not performed. This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation. </p> <p class="leafygreen-ui-1kp3ins"> In MongoDB versions earlier than 6.0.3, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.startBalancer/#mongodb-method-sh.startBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.startBalancer() </code> </a> also enables auto-splitting for the sharded cluster. </p> <p class="leafygreen-ui-1kp3ins"> If you do not wish to enable auto-splitting while the balancer is enabled, you must also run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.disableAutoSplit/#mongodb-method-sh.disableAutoSplit"> <code class="leafygreen-ui-1l06pbn"> sh.disableAutoSplit() </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> For more information about re-enabling the balancer, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-sharded-cluster-balancer/#std-label-sharding-balancing-enable"> Enable the Balancer <!-- --> . </a> </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 7 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Enable backwards-incompatible <!-- --> 6.0 <!-- --> features. <a class="headerlink leafygreen-ui-1kepx47" href="#enable-backwards-incompatible--features." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="enable-backwards-incompatible--features."> </div> </a> </h3> <span class="leafygreen-ui-1qnjd6d" id="std-label-6.0-upgrade-enable-features-mongos"> </span> <p class="leafygreen-ui-1kp3ins"> At this point, you can run the <!-- --> 6.0 <!-- --> binaries without the <!-- --> 6.0 <!-- --> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/6.0-compatibility/#std-label-6.0-downgrade-considerations"> features </a> that are incompatible with <!-- --> 5.0 <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> To enable these <!-- --> 6.0 <!-- --> features, set the feature compatibility version ( <code class="leafygreen-ui-1l06pbn"> fCV </code> ) to <!-- --> 6.0 <!-- --> . </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Enabling these backwards-incompatible features can complicate the downgrade process since you must remove any persisted backwards-incompatible features before you downgrade. </p> <p class="leafygreen-ui-1kp3ins"> It is recommended that after upgrading, you allow your deployment to run without enabling these features for a burn-in period to ensure the likelihood of downgrade is minimal. When you are confident that the likelihood of downgrade is minimal, enable these features. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> On a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance, run the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#mongodb-dbcommand-dbcmd.setFeatureCompatibilityVersion"> <code class="leafygreen-ui-1l06pbn"> setFeatureCompatibilityVersion </code> </a> command in the <code class="leafygreen-ui-1l06pbn"> admin </code> database: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { setFeatureCompatibilityVersion: \"6.0\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">setFeatureCompatibilityVersion</span>: <span class="lg-highlight-string">"6.0"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Setting <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-set-fcv"> featureCompatibilityVersion (fCV) : "6.0" </a> implicitly performs a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetReconfig/#mongodb-dbcommand-dbcmd.replSetReconfig"> <code class="leafygreen-ui-1l06pbn"> replSetReconfig </code> </a> on each shard to add the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.term"> <code class="leafygreen-ui-1l06pbn"> term </code> </a> field to the shard replica configuration document. </p> <p class="leafygreen-ui-1kp3ins"> The command doesn't complete until the new configuration propagates to a majority of replica set members. </p> <p class="leafygreen-ui-1kp3ins"> This command must perform writes to an internal system collection. If for any reason the command does not complete successfully, you can safely retry the command on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> as the operation is idempotent. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> While <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#mongodb-dbcommand-dbcmd.setFeatureCompatibilityVersion"> <code class="leafygreen-ui-1l06pbn"> setFeatureCompatibilityVersion </code> </a> is running on the sharded cluster, chunk migrations, splits, and merges can fail with <code class="leafygreen-ui-1l06pbn"> ConflictingOperationInProgress </code> . </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Any <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-orphaned-document"> orphaned documents </a> that exist on your shards will be cleaned up when you set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#mongodb-dbcommand-dbcmd.setFeatureCompatibilityVersion"> <code class="leafygreen-ui-1l06pbn"> setFeatureCompatibilityVersion </code> </a> to <!-- --> 6.0 <!-- --> . The cleanup process: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Does not block the upgrade from completing, and </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Is rate limited. To mitigate the potential effect on performance during orphaned document cleanup, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-balancer-administration/#std-label-range-deletion-performance-tuning"> Range Deletion Performance Tuning <!-- --> . </a> </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Additional Consideration </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> binary cannot connect to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances whose <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-view-fcv"> feature compatibility version (fCV) </a> is greater than that of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> . For example, you cannot connect a MongoDB <!-- --> 5.0 <!-- --> version <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> to a <!-- --> 6.0 <!-- --> sharded cluster with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-view-fcv"> fCV </a> set to <!-- --> 6.0 <!-- --> . You can, however, connect a MongoDB <!-- --> 5.0 <!-- --> version <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> to a <!-- --> 6.0 <!-- --> sharded cluster with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-view-fcv"> fCV </a> set to <!-- --> 5.0 <!-- --> . </p> </div> </div> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Additional Upgrade Procedures <a class="headerlink leafygreen-ui-1kepx47" href="#additional-upgrade-procedures" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="additional-upgrade-procedures"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To upgrade a standalone, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/6.0-upgrade-standalone/#std-label-6.0-upgrade-standalone"> Upgrade a Standalone to 6.0 <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To upgrade a replica set, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/6.0-upgrade-replica-set/#std-label-6.0-upgrade-replica-set"> Upgrade a Replica Set to 6.0 <!-- --> . </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/isoWeekYear/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $isoWeekYear (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-isoweekyear--aggregation-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-isoweekyear--aggregation-"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $isoWeekYear </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-isoWeekYear" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-expression-exp.-isoWeekYear"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns the year number in ISO 8601 format. The year starts with the Monday of week 1 and ends with the Sunday of the last week. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-isoWeekYear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $isoWeekYear </code> </span> </a> expression has the following <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> operator expression syntax <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $isoWeekYear: &lt;dateexpression&gt; }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$isoWeekYear</span>: &lt;<!-- -->dateExpression<!-- -->&gt; <!-- -->}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The argument can be: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> An <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-date"> Date </a> , a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-timestamp"> Timestamp </a> , or an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-object-id"> ObjectID <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A document with this format: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ date: &lt;dateexpression&gt;, timezone: &lt;tzexpression&gt; }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">date</span>: &lt;<!-- -->dateExpression<!-- -->&gt;<!-- -->,<!-- --> <span class="lg-highlight-attr">timezone</span>: &lt;<!-- -->tzExpression<!-- -->&gt; <!-- -->}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:25%"/> <col style="width:75%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> date </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The date to which the operator is applied. <code class="leafygreen-ui-1l06pbn"> &lt;dateExpression&gt; </code> must be a valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-date"> Date </a> , a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-timestamp"> Timestamp </a> , or an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-object-id"> ObjectID <!-- --> . </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timezone </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The timezone of the operation result. <code class="leafygreen-ui-1l06pbn"> &lt;tzExpression&gt; </code> must be a valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a string formatted as either an <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones" rel="noopener noreferrer"> <span> Olson Timezone Identifier </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> or a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/List_of_UTC_time_offsets" rel="noopener noreferrer"> <span> UTC Offset </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> . If no <code class="leafygreen-ui-1l06pbn"> timezone </code> is provided, the result is in UTC. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Format </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Examples </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> Olson Timezone Identifier </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"America/New_York\"\n\"Europe/London\"\n\"GMT\""} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">"America/New_York"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">"Europe/London"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">"GMT"</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> UTC Offset </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"+/-[hh]:[mm], e.g. \"+04:45\"\n+/-[hh][mm], e.g. \"-0530\"\n+/-[hh], e.g. \"+03\""} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">+/-[hh]:[mm], e.g. "+04:45"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">+/-[hh][mm], e.g. "-0530"</td></tr><tr class=""><td class="leafygreen-ui-7razhx">+/-[hh], e.g. "+03"</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </td> </tr> </tbody> </table> </div> </div> </div> </td> </tr> </tbody> </table> </div> </li> </ul> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:90%"/> <col style="width:10%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Result </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $isoWeekYear: new Date(\"2015-05-26\") }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$isoWeekYear</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2015-05-26"</span>) }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 2015 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $isoWeekYear: { date: new Date(\"Jan 7, 2003\") } }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$isoWeekYear</span>: <!-- -->{ <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"Jan 7, 2003"</span>) } }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 2003 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $isoWeekYear: ISODate(\"2017-01-02T00:00:00Z\") }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$isoWeekYear</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2017-01-02T00:00:00Z"</span>) }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 2017 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $isoWeekYear: {\n date: ISODate(\"2017-01-02T00:00:00Z\"),\n timezone: \"-0500\"\n} }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$isoWeekYear</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2017-01-02T00:00:00Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timezone</span>: <span class="lg-highlight-string">"-0500"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 2016 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $isoWeekYear: {\n date: new Date(\"April 08, 2024\"),\n timezone: \"America/Chicago\"\n} }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$isoWeekYear</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"April 08, 2024"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timezone</span>: <span class="lg-highlight-string">"America/Chicago"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 2024 </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $isoWeekYear: \"March 28, 1976\" }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$isoWeekYear</span>: <span class="lg-highlight-string">"March 28, 1976"</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> error </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $isoWeekYear: Date(\"2016-01-01\") }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$isoWeekYear</span>: <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2016-01-01"</span>) }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> error </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $isoWeekYear: \"2009-04-09\" }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$isoWeekYear</span>: <span class="lg-highlight-string">"2009-04-09"</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> error </code> </div> </div> </td> </tr> </tbody> </table> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> $isoWeekYear cannot take a string as an argument. </strong> </h3> <div class="leafygreen-ui-9mycqc"> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A collection called <code class="leafygreen-ui-1l06pbn"> anniversaries </code> contains the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"date\" : ISODate(\"2016-01-01T00:00:00Z\") }\n{ \"_id\" : 2, \"date\" : ISODate(\"2016-01-04T00:00:00Z\") }\n{ \"_id\" : 3, \"date\" : ISODate(\"2015-01-01T00:00:00Z\") }\n{ \"_id\" : 4, \"date\" : ISODate(\"2014-04-21T00:00:00Z\") }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2016-01-01T00:00:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2016-01-04T00:00:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2015-01-01T00:00:00Z"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"date"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2014-04-21T00:00:00Z"</span>) }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation returns the year number in ISO 8601 format for each <code class="leafygreen-ui-1l06pbn"> date </code> field. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.anniversaries.aggregate( [\n {\n $project: {\n yearNumber: { $isoWeekYear: \"$date\" }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">anniversaries</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">yearNumber</span>: <!-- -->{ <span class="lg-highlight-attr">$isoWeekYear</span>: <span class="lg-highlight-string">"$date"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"yearNumber\" : 2015 }\n{ \"_id\" : 2, \"yearNumber\" : 2016 }\n{ \"_id\" : 3, \"yearNumber\" : 2015 }\n{ \"_id\" : 4, \"yearNumber\" : 2014 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"yearNumber"</span> <!-- -->: <span class="lg-highlight-number">2015</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"yearNumber"</span> <!-- -->: <span class="lg-highlight-number">2016</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"yearNumber"</span> <!-- -->: <span class="lg-highlight-number">2015</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"yearNumber"</span> <!-- -->: <span class="lg-highlight-number">2014</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/isoDayOfWeek/"> $isoDayOfWeek (aggregation) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/isoWeek/"> $isoWeek (aggregation) </a> </p> </li> </ul> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/administration/install-community/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Install MongoDB Community Edition <a class="headerlink leafygreen-ui-1kepx47" href="#install-mongodb-community-edition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="install-mongodb-community-edition"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> These documents provide instructions to install MongoDB Community Edition. </p> <dl> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-on-linux/#std-label-install-mdb-community-edition-linux"> Install on Linux </a> </dt> <dd class="css-1ufxuu7"> Install MongoDB Community Edition and required dependencies on Linux. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-on-os-x/#std-label-install-mdb-community-macos"> Install on macOS </a> </dt> <dd class="css-1ufxuu7"> Install MongoDB Community Edition on macOS systems from MongoDB archives. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-on-windows/#std-label-install-mdb-community-windows"> Install on Windows </a> </dt> <dd class="css-1ufxuu7"> Install MongoDB Community Edition on Windows systems and optionally start MongoDB as a Windows service. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-community-with-docker/#std-label-docker-mongodb-community-install"> Install on Docker </a> </dt> <dd class="css-1ufxuu7"> Install a MongoDB Community Docker container. </dd> </dl> </section>
https://www.mongodb.com/docs/manual/reference/method/db.serverStatus/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.serverStatus() <a class="headerlink leafygreen-ui-1kepx47" href="#db.serverstatus--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="db.serverstatus--"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#output" target="_self"> <span> Output </span> </a> </li> </ul> </div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.serverStatus() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.serverStatus" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-db.serverStatus"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-document"> document </a> that provides an overview of the database process's state. </p> <p class="leafygreen-ui-1kp3ins"> This command provides a wrapper around the database command <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-dbcommand-dbcmd.serverStatus"> <code class="leafygreen-ui-1l06pbn"> serverStatus </code> . </a> </p> </dd> </dl> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This method is available in deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> By default, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.serverStatus" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.serverStatus() </code> </span> </a> excludes in its output: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> some content in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#std-label-server-status-repl"> repl </a> document. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#std-label-server-status-mirroredReads"> mirroredReads </a> document. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> To include fields that are excluded by default, specify the top-level field and set it to <code class="leafygreen-ui-1l06pbn"> 1 </code> in the command. To exclude fields that are included by default, specify the field and set to 0. You can specify either top-level or embedded fields. </p> <p class="leafygreen-ui-1kp3ins"> For example, the following operation suppresses the <code class="leafygreen-ui-1l06pbn"> repl </code> , <code class="leafygreen-ui-1l06pbn"> metrics </code> and <code class="leafygreen-ui-1l06pbn"> locks </code> information in the output. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.serverStatus( { repl: 0, metrics: 0, locks: 0 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">serverStatus</span>( <!-- -->{ <span class="lg-highlight-attr">repl</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">metrics</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">locks</span>: <span class="lg-highlight-number">0</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example includes all <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#std-label-server-status-repl"> repl </a> information in the output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.serverStatus( { repl: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">serverStatus</span>( <!-- -->{ <span class="lg-highlight-attr">repl</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Initialization <a class="headerlink leafygreen-ui-1kepx47" href="#initialization" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="initialization"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The statistics reported by <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.serverStatus" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.serverStatus() </code> </span> </a> are reset when the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> server is restarted. The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.serverStatus" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.serverStatus() </code> </span> </a> command does not report some statistics until they have been initialized by server events. </p> <p class="leafygreen-ui-1kp3ins"> For example, after restarting the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> server, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.serverStatus" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.serverStatus() </code> </span> </a> won't return any values for <code class="leafygreen-ui-1l06pbn"> findAndModify </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.serverStatus().metrics.commands.findAndModify\n// No results returned","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">serverStatus</span>(<!-- -->).<span class="lg-highlight-property">metrics</span>.<span class="lg-highlight-property">commands</span>.<span class="lg-highlight-property">findAndModify</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">// No results returned</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> After you run an update query, subsequent calls to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.serverStatus" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.serverStatus() </code> </span> </a> display the expected metrics. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"arrayFilters\" : NumberLong(0),\n \"failed\" : NumberLong(0),\n \"pipeline\" : NumberLong(0),\n \"total\" : NumberLong(1)\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"arrayFilters"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">0</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"failed"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">0</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"pipeline"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">0</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"total"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">1</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> db.serverStatus() </code> method returns an error if a specific object is queried before the counters have begun to increment. </p> <p class="leafygreen-ui-1kp3ins"> If there haven't been any document updates yet: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.serverStatus().metrics.commands.update.pipeline","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">serverStatus</span>(<!-- -->).<span class="lg-highlight-property">metrics</span>.<span class="lg-highlight-property">commands</span>.<span class="lg-highlight-property">update</span>.<span class="lg-highlight-property">pipeline</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Returns: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"TypeError: db.serverStatus(...).metrics.commands.update is undefined :\n@(shell):1:1","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">TypeError</span>: <!-- -->db.<span class="lg-highlight-title lg-highlight-function">serverStatus</span>(<!-- -->...<!-- -->).<span class="lg-highlight-property">metrics</span>.<span class="lg-highlight-property">commands</span>.<span class="lg-highlight-property">update</span> is <span class="lg-highlight-literal">undefined</span> <!-- -->:</td></tr><tr class=""><td class="leafygreen-ui-7razhx">@<!-- -->(<!-- -->shell)<!-- -->:<span class="lg-highlight-number">1</span>:<span class="lg-highlight-number">1</span></td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Include <code class="leafygreen-ui-1l06pbn"> mirroredReads </code> <a class="headerlink leafygreen-ui-1kepx47" href="#include-mirroredreads" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="include-mirroredreads"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> By default, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.mirroredReads"> <code class="leafygreen-ui-1l06pbn"> mirroredReads </code> </a> information is not included in the output. To return <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.mirroredReads"> <code class="leafygreen-ui-1l06pbn"> mirroredReads </code> </a> information, you must explicitly specify the inclusion: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.serverStatus( { mirroredReads: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">serverStatus</span>( <!-- -->{ <span class="lg-highlight-attr">mirroredReads</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Output <a class="headerlink leafygreen-ui-1kepx47" href="#output" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="output"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#std-label-server-status-output"> serverStatus Output </a> for complete documentation of the output of this function. </p> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/configure-ldap-sasl-activedirectory/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Authenticate Using Self-Managed SASL and LDAP with ActiveDirectory <a class="headerlink leafygreen-ui-1kepx47" href="#authenticate-using-self-managed-sasl-and-ldap-with-activedirectory" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="authenticate-using-self-managed-sasl-and-ldap-with-activedirectory"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#considerations" target="_self"> <span> Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#configure-saslauthd" target="_self"> <span> Configure <code class="css-1kekw28 e1wawog0"> saslauthd </code> </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#configure-mongodb" target="_self"> <span> Configure MongoDB </span> </a> </li> </ul> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, LDAP authentication and authorization is deprecated. LDAP is available and will continue to operate without changes throughout the lifetime of MongoDB 8. LDAP will be removed in a future major release. </p> <p class="leafygreen-ui-1kp3ins"> For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/LDAP-deprecation/#std-label-ldap-deprecation"> LDAP Deprecation <!-- --> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB Enterprise provides support for proxy authentication of users. This allows administrators to configure a MongoDB cluster to authenticate users by proxying authentication requests to a specified Lightweight Directory Access Protocol (LDAP) service. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For MongoDB 4.2 Enterprise binaries linked against <code class="leafygreen-ui-1l06pbn"> libldap </code> (such as when running on RHEL), access to the <code class="leafygreen-ui-1l06pbn"> libldap </code> is synchronized, incurring some performance/latency costs. </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB 4.2 Enterprise binaries linked against <code class="leafygreen-ui-1l06pbn"> libldap_r </code> , there is no change in behavior from earlier MongoDB versions. </p> </div> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#considerations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="considerations"> </div> </a> </h2> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB Enterprise for Windows does not support binding via <code class="leafygreen-ui-1l06pbn"> saslauthd </code> . </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Linux MongoDB servers support binding to an LDAP server via the <code class="leafygreen-ui-1l06pbn"> saslauthd </code> daemon. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use secure encrypted or trusted connections between clients and the server, as well as between <code class="leafygreen-ui-1l06pbn"> saslauthd </code> and the LDAP server. The LDAP server uses the <code class="leafygreen-ui-1l06pbn"> SASL PLAIN </code> mechanism, sending and receiving data in <strong> plain text </strong> . You should use only a trusted channel such as a VPN, a connection encrypted with TLS/SSL, or a trusted wired network. </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Configure <code class="leafygreen-ui-1l06pbn"> saslauthd </code> <a class="headerlink leafygreen-ui-1kepx47" href="#configure-saslauthd" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="configure-saslauthd"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> LDAP support for user authentication requires proper configuration of the <code class="leafygreen-ui-1l06pbn"> saslauthd </code> daemon process as well as the MongoDB server. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Specify the mechanism.On systems that configure saslauthd with the\n/etc/sysconfig/saslauthd file, such as Red Hat Enterprise Linux,\nFedora, CentOS, and Amazon Linux AMI, set the mechanism MECH to\nldap:On systems that configure saslauthd with the\n/etc/default/saslauthd file, such as Ubuntu, set the MECHANISMS\noption to ldap:"},{"@type":"HowToStep","text":"Adjust caching behavior.On certain Linux distributions, saslauthd starts with the caching\nof authentication credentials enabled. Until restarted or until the\ncache expires, saslauthd will not contact the LDAP server to\nre-authenticate users in its authentication cache. This allows\nsaslauthd to successfully authenticate users in its cache, even in\nthe LDAP server is down or if the cached users' credentials are revoked.To set the expiration time (in seconds) for the authentication cache, see\nthe -t option of\nsaslauthd."},{"@type":"HowToStep","text":"Configure LDAP Options with ActiveDirectory.If the saslauthd.conf file does not exist, create it.\nThe saslauthd.conf file usually resides in the /etc\nfolder. If specifying a different file path, see the\n-O option of\nsaslauthd.To use with ActiveDirectory, start saslauthd with the following\nconfiguration options set in the saslauthd.conf file:For the <ldap uri>, specify the uri of the ldap server. For\nexample, ldap_servers: ldaps://ad.example.net.For more information on saslauthd configuration, see\nhttp://www.openldap.org/doc/admin24/guide.html#Configuringsaslauthd."},{"@type":"HowToStep","text":"Test the saslauthd configuration.Use testsaslauthd utility to test the saslauthd\nconfiguration. For example:0: OK \"Success\" indicates successful authentication.0: NO \"authentication failed\" indicates a username, password, or\nconfiguration error.Modify the file path with respect to the location of the\nsaslauthd directory on the host operating system.The parent directory of the saslauthd Unix domain socket file\nspecified to security.sasl.saslauthdSocketPath or\n--setParameter saslauthdPath must grant\nread and execute (r-x) permissions for either:The user starting the mongod or\nmongos, orA group to which that user belongs.The mongod or mongos cannot successfully authenticate via\nsaslauthd without the specified permission on the saslauthd\ndirectory and its contents."}],"name":"Configure saslauthd","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify the mechanism. <a class="headerlink leafygreen-ui-1kepx47" href="#specify-the-mechanism" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="specify-the-mechanism"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> On systems that configure <code class="leafygreen-ui-1l06pbn"> saslauthd </code> with the <code class="leafygreen-ui-1l06pbn"> /etc/sysconfig/saslauthd </code> file, such as Red Hat Enterprise Linux, Fedora, CentOS, and Amazon Linux AMI, set the mechanism <code class="leafygreen-ui-1l06pbn"> MECH </code> to <code class="leafygreen-ui-1l06pbn"> ldap </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"MECH=ldap\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-variable lg-highlight-constant">MECH</span>=<!-- -->ldap</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> On systems that configure <code class="leafygreen-ui-1l06pbn"> saslauthd </code> with the <code class="leafygreen-ui-1l06pbn"> /etc/default/saslauthd </code> file, such as Ubuntu, set the <code class="leafygreen-ui-1l06pbn"> MECHANISMS </code> option to <code class="leafygreen-ui-1l06pbn"> ldap </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"MECHANISMS=\"ldap\"\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-variable lg-highlight-constant">MECHANISMS</span>=<span class="lg-highlight-string">"ldap"</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Adjust caching behavior. <a class="headerlink leafygreen-ui-1kepx47" href="#adjust-caching-behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="adjust-caching-behavior"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> On certain Linux distributions, <code class="leafygreen-ui-1l06pbn"> saslauthd </code> starts with the caching of authentication credentials <em> enabled </em> . Until restarted or until the cache expires, <code class="leafygreen-ui-1l06pbn"> saslauthd </code> will not contact the LDAP server to re-authenticate users in its authentication cache. This allows <code class="leafygreen-ui-1l06pbn"> saslauthd </code> to successfully authenticate users in its cache, even in the LDAP server is down or if the cached users' credentials are revoked. </p> <p class="leafygreen-ui-1kp3ins"> To set the expiration time (in seconds) for the authentication cache, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.linuxcommand.org/man_pages/saslauthd8.html" rel="noopener noreferrer"> <span> -t option </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> of <code class="leafygreen-ui-1l06pbn"> saslauthd </code> . </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Configure LDAP Options with ActiveDirectory. <a class="headerlink leafygreen-ui-1kepx47" href="#configure-ldap-options-with-activedirectory" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="configure-ldap-options-with-activedirectory"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If the <code class="leafygreen-ui-1l06pbn"> saslauthd.conf </code> file does not exist, create it. The <code class="leafygreen-ui-1l06pbn"> saslauthd.conf </code> file usually resides in the <code class="leafygreen-ui-1l06pbn"> /etc </code> folder. If specifying a different file path, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.linuxcommand.org/man_pages/saslauthd8.html" rel="noopener noreferrer"> <span> -O option </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> of <code class="leafygreen-ui-1l06pbn"> saslauthd </code> . </p> <p class="leafygreen-ui-1kp3ins"> To use with ActiveDirectory, start <code class="leafygreen-ui-1l06pbn"> saslauthd </code> with the following configuration options set in the <code class="leafygreen-ui-1l06pbn"> saslauthd.conf </code> file: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"ldap_servers: &lt;ldap&gt;\nldap_use_sasl: yes\nldap_mech: DIGEST-MD5\nldap_auth_method: fastbind\n"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">ldap_servers: &lt;ldap uri&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">ldap_use_sasl: yes</td></tr><tr class=""><td class="leafygreen-ui-7razhx">ldap_mech: DIGEST-MD5</td></tr><tr class=""><td class="leafygreen-ui-7razhx">ldap_auth_method: fastbind</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For the <code class="leafygreen-ui-1l06pbn"> &lt;ldap uri&gt; </code> , specify the uri of the ldap server. For example, <code class="leafygreen-ui-1l06pbn"> ldap_servers: ldaps://ad.example.net </code> . </p> <p class="leafygreen-ui-1kp3ins"> For more information on <code class="leafygreen-ui-1l06pbn"> saslauthd </code> configuration, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.openldap.org/doc/admin24/guide.html#Configuringsaslauthd" rel="noopener noreferrer"> <span> http://www.openldap.org/doc/admin24/guide.html#Configuringsaslauthd </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> . </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Test the <code class="leafygreen-ui-1l06pbn"> saslauthd </code> configuration. <a class="headerlink leafygreen-ui-1kepx47" href="#test-the-saslauthd-configuration" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="test-the-saslauthd-configuration"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use <code class="leafygreen-ui-1l06pbn"> testsaslauthd </code> utility to test the <code class="leafygreen-ui-1l06pbn"> saslauthd </code> configuration. For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"testsaslauthd -u testuser -p testpassword -f /var/run/saslauthd/mux\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">testsaslauthd -u testuser -p testpassword -f /var/run/saslauthd/mux</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> 0: OK "Success" </code> indicates successful authentication. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> 0: NO "authentication failed" </code> indicates a username, password, or configuration error. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Modify the file path with respect to the location of the <code class="leafygreen-ui-1l06pbn"> saslauthd </code> directory on the host operating system. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The parent directory of the <code class="leafygreen-ui-1l06pbn"> saslauthd </code> Unix domain socket file specified to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.sasl.saslauthdSocketPath"> <code class="leafygreen-ui-1l06pbn"> security.sasl.saslauthdSocketPath </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.saslauthdPath"> <code class="leafygreen-ui-1l06pbn"> --setParameter saslauthdPath </code> </a> must grant read and execute ( <code class="leafygreen-ui-1l06pbn"> r-x </code> ) permissions for either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The user starting the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , <em> or </em> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A group to which that user belongs. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> cannot successfully authenticate via <code class="leafygreen-ui-1l06pbn"> saslauthd </code> without the specified permission on the <code class="leafygreen-ui-1l06pbn"> saslauthd </code> directory and its contents. </p> </div> </div> </section> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-configure-mongodb-auth-users-activeDirectory"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Configure MongoDB <a class="headerlink leafygreen-ui-1kepx47" href="#configure-mongodb" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="configure-mongodb"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Add user to MongoDB for authentication.Add the user to the $external database in MongoDB. To specify the\nuser's privileges, assign roles to the\nuser.To use Client Sessions and Causal Consistency Guarantees with $external authentication users\n(Kerberos, LDAP, or x.509 users), usernames cannot be greater\nthan 10k bytes.For example, the following adds a user with read-only access to\nthe records database.Add additional principals as needed. For more\ninformation about creating and managing users, see\nUser Management Commands."},{"@type":"HowToStep","text":"Configure MongoDB server.To configure the MongoDB server to use the saslauthd instance for\nproxy authentication, include the following options when starting mongod:--auth command line option or security.authorization setting,authenticationMechanisms parameter set to PLAIN, andsaslauthdPath parameter set to the path to the Unix-domain Socket of the saslauthd instance.The parent directory of the saslauthd Unix domain socket file\nspecified to security.sasl.saslauthdSocketPath or\n--setParameter saslauthdPath must grant\nread and execute (r-x) permissions for either:The user starting the mongod or\nmongos, orA group to which that user belongs.The mongod or mongos cannot successfully authenticate via\nsaslauthd without the specified permission on the saslauthd\ndirectory and its contents.If you use the authorization option to enforce\nauthentication, you will need privileges to create a user.Use specific saslauthd socket path.For socket path of /<some>/<path>/saslauthd, set the\nsaslauthdPath to /<some>/<path>/saslauthd/mux,\nas in the following command line example:Include additional options as required for your configuration. For\ninstance, if you wish remote clients to connect to your deployment\nor your deployment members are run on different hosts, specify the\n--bind_ip.Or if using a YAML format configuration file, specify the following settings in\nthe file:Or, if using the older configuration file format:Use default Unix-domain socket path.To use the default Unix-domain socket path, set the\nsaslauthdPath to the empty string \"\", as in the\nfollowing command line example:Include additional options as required for your configuration. For\ninstance, if you wish remote clients to connect to your deployment\nor your deployment members are run on different hosts, specify the\n--bind_ip.Or if using a YAML format configuration file, specify the following settings in\nthe file:Or, if using the older configuration file format:Include additional options as required\nfor your configuration. For instance, if you wish remote clients to\nconnect to your deployment or your deployment members are run on\ndifferent hosts, specify the net.bindIp setting."},{"@type":"HowToStep","text":"Authenticate the user in mongosh.You can authenticate from the command line during connection, or\nconnect first and then authenticate using db.auth() method.To authenticate when connecting with\nmongosh, run mongosh with the following\ncommand-line options, substituting <host> and\n<user>, and enter your password when prompted:Alternatively, connect without supplying credentials and then call\nthe db.auth() method on the $external database. Specify\nthe value \"PLAIN\" in the mechanism field, the user and\npassword in the user and pwd fields respectively. Use the default\ndigestPassword value (false) since the server must receive an\nundigested password to forward on to saslauthd, as in the\nfollowing example:You can use the passwordPrompt() method in conjunction with\nvarious user authentication management methods and commands to prompt\nfor the password instead of specifying the password directly in the\nmethod or command call. However, you can still specify the password\ndirectly as you would with earlier versions of the\nmongo shell.Enter the password when prompted.The server forwards the password in plain text. In general, use only\non a trusted channel (VPN, TLS/SSL, trusted wired network). See\nConsiderations."}],"name":"Configure MongoDB","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Add user to MongoDB for authentication. <a class="headerlink leafygreen-ui-1kepx47" href="#add-user-to-mongodb-for-authentication" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="add-user-to-mongodb-for-authentication"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Add the user to the <code class="leafygreen-ui-1l06pbn"> $external </code> database in MongoDB. To specify the user's privileges, assign <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/#std-label-authorization"> roles </a> to the user. </p> <p class="leafygreen-ui-1kp3ins"> To use <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-isolation-consistency-recency/#std-label-sessions"> Client Sessions and Causal Consistency Guarantees </a> with <code class="leafygreen-ui-1l06pbn"> $external </code> authentication users (Kerberos, LDAP, or x.509 users), usernames cannot be greater than 10k bytes. </p> <p class="leafygreen-ui-1kp3ins"> For example, the following adds a user with read-only access to the <code class="leafygreen-ui-1l06pbn"> records </code> database. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.getSiblingDB(\"$external\").createUser(\n {\n user : &lt;username&gt;,\n roles: [ { role: \"read\", db: \"records\" } ]\n }\n)\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.getSiblingDB("$external").createUser(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> user : &lt;username&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> roles: [ { role: "read", db: "records" } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Add additional principals as needed. For more information about creating and managing users, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/nav-user-management/"> User Management Commands <!-- --> . </a> </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Configure MongoDB server. <a class="headerlink leafygreen-ui-1kepx47" href="#configure-mongodb-server" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="configure-mongodb-server"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To configure the MongoDB server to use the <code class="leafygreen-ui-1l06pbn"> saslauthd </code> instance for proxy authentication, include the following options when starting <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> : </a> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--auth"> <code class="leafygreen-ui-1l06pbn"> --auth </code> </a> command line option or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.authorization"> <code class="leafygreen-ui-1l06pbn"> security.authorization </code> </a> setting, </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.authenticationMechanisms"> <code class="leafygreen-ui-1l06pbn"> authenticationMechanisms </code> </a> parameter set to <code class="leafygreen-ui-1l06pbn"> PLAIN </code> , and </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.saslauthdPath"> <code class="leafygreen-ui-1l06pbn"> saslauthdPath </code> </a> parameter set to the path to the Unix-domain Socket of the <code class="leafygreen-ui-1l06pbn"> saslauthd </code> instance. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The parent directory of the <code class="leafygreen-ui-1l06pbn"> saslauthd </code> Unix domain socket file specified to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.sasl.saslauthdSocketPath"> <code class="leafygreen-ui-1l06pbn"> security.sasl.saslauthdSocketPath </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.saslauthdPath"> <code class="leafygreen-ui-1l06pbn"> --setParameter saslauthdPath </code> </a> must grant read and execute ( <code class="leafygreen-ui-1l06pbn"> r-x </code> ) permissions for either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The user starting the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , <em> or </em> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A group to which that user belongs. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> cannot successfully authenticate via <code class="leafygreen-ui-1l06pbn"> saslauthd </code> without the specified permission on the <code class="leafygreen-ui-1l06pbn"> saslauthd </code> directory and its contents. </p> </div> </div> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If you use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.authorization"> <code class="leafygreen-ui-1l06pbn"> authorization </code> </a> option to enforce authentication, you will need privileges to create a user. </p> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Use specific <code class="leafygreen-ui-1l06pbn"> saslauthd </code> socket path. <a class="headerlink leafygreen-ui-1kepx47" href="#use-specific-saslauthd-socket-path" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-specific-saslauthd-socket-path"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> For socket path of <code class="leafygreen-ui-1l06pbn"> /&lt;some&gt;/&lt;path&gt;/saslauthd </code> , set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.saslauthdPath"> <code class="leafygreen-ui-1l06pbn"> saslauthdPath </code> </a> to <code class="leafygreen-ui-1l06pbn"> /&lt;some&gt;/&lt;path&gt;/saslauthd/mux </code> , as in the following command line example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --auth --setParameter saslauthdPath=/&lt;some&gt;/&lt;path&gt;/saslauthd/mux --setParameter authenticationMechanisms=PLAIN\n"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --auth --setParameter saslauthdPath=/&lt;some&gt;/&lt;path&gt;/saslauthd/mux --setParameter authenticationMechanisms=PLAIN</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> . </p> </section> <p class="leafygreen-ui-1kp3ins"> Or if using a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/"> YAML format configuration file </a> , specify the following settings in the file: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"security:\n authorization: enabled\n\nsetParameter:\n saslauthdPath: /&lt;some&gt;/&lt;path&gt;/saslauthd/mux\n authenticationMechanisms: PLAIN","programmingLanguage":"YAML"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light yaml leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">security:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">authorization:</span> <span class="lg-highlight-string">enabled</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">setParameter:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">saslauthdPath:</span> <span class="lg-highlight-string">/&lt;some&gt;/&lt;path&gt;/saslauthd/mux</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">authenticationMechanisms:</span> <span class="lg-highlight-string">PLAIN</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Or, if using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/v2.4/reference/configuration-options/" target="_self"> <span> older configuration file format <!-- --> : </span> </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"auth=true\nsetParameter=saslauthdPath=/&lt;some&gt;/&lt;path&gt;/saslauthd/mux\nsetParameter=authenticationMechanisms=PLAIN","programmingLanguage":"Ini"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light ini leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">auth</span>=<span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">setParameter</span>=saslauthdPath=/&lt;some&gt;/&lt;path&gt;/saslauthd/mux</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">setParameter</span>=authenticationMechanisms=PLAIN</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Use default Unix-domain socket path. <a class="headerlink leafygreen-ui-1kepx47" href="#use-default-unix-domain-socket-path" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-default-unix-domain-socket-path"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> To use the default Unix-domain socket path, set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.saslauthdPath"> <code class="leafygreen-ui-1l06pbn"> saslauthdPath </code> </a> to the empty string <code class="leafygreen-ui-1l06pbn"> "" </code> , as in the following command line example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --auth --setParameter saslauthdPath=\"\" --setParameter authenticationMechanisms=PLAIN\n"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --auth --setParameter saslauthdPath="" --setParameter authenticationMechanisms=PLAIN</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> . </p> </section> <p class="leafygreen-ui-1kp3ins"> Or if using a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/"> YAML format configuration file </a> , specify the following settings in the file: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"security:\n authorization: enabled\n\nsetParameter:\n saslauthdPath: \"\"\n authenticationMechanisms: PLAIN","programmingLanguage":"YAML"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light yaml leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">security:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">authorization:</span> <span class="lg-highlight-string">enabled</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">setParameter:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">saslauthdPath:</span> <span class="lg-highlight-string">""</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">authenticationMechanisms:</span> <span class="lg-highlight-string">PLAIN</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Or, if using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/v2.4/reference/configuration-options/" target="_self"> <span> older configuration file format <!-- --> : </span> </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"auth=true\nsetParameter=saslauthdPath=\"\"\nsetParameter=authenticationMechanisms=PLAIN","programmingLanguage":"Ini"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light ini leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">auth</span>=<span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">setParameter</span>=saslauthdPath=<span class="lg-highlight-string">""</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">setParameter</span>=authenticationMechanisms=PLAIN</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> setting. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Authenticate the user in <code class="leafygreen-ui-1l06pbn"> mongosh </code> . <a class="headerlink leafygreen-ui-1kepx47" href="#authenticate-the-user-in-mongosh" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="authenticate-the-user-in-mongosh"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can authenticate from the command line during connection, or connect first and then authenticate using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.auth/#mongodb-method-db.auth"> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </a> method. </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-16"> <div aria-label="Tabs to describe usage of authafter/cmdline" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_besn4c358" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_vya4y5t2t" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Authenticate during Connection </div> </button> <button aria-controls="_0dvk53uo9" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2rttm3g9f" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Authenticate after Connection </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_gq4wsbwhy" class="" id="_9n3nibei3" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> To authenticate when connecting with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , run <code class="leafygreen-ui-1l06pbn"> mongosh </code> with the following command-line options, substituting <code class="leafygreen-ui-1l06pbn"> &lt;host&gt; </code> and <code class="leafygreen-ui-1l06pbn"> &lt;user&gt; </code> , and enter your password when prompted: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh --host &lt;host&gt; --authenticationMechanism PLAIN --authenticationDatabase '$external' -u &lt;user&gt; -p","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh --host &lt;host&gt; --authenticationMechanism PLAIN --authenticationDatabase <span class="lg-highlight-string">'$external'</span> -u &lt;user&gt; -p</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_3lwnct5xy" class="leafygreen-ui-38lglc" id="_dusjxwxcn" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> Alternatively, connect without supplying credentials and then call the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.auth/#mongodb-method-db.auth"> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </a> method on the <code class="leafygreen-ui-1l06pbn"> $external </code> database. Specify the value <code class="leafygreen-ui-1l06pbn"> "PLAIN" </code> in the <code class="leafygreen-ui-1l06pbn"> mechanism </code> field, the user and password in the <code class="leafygreen-ui-1l06pbn"> user </code> and <code class="leafygreen-ui-1l06pbn"> pwd </code> fields respectively. Use the default <code class="leafygreen-ui-1l06pbn"> digestPassword </code> value ( <code class="leafygreen-ui-1l06pbn"> false </code> ) since the server must receive an undigested password to forward on to <code class="leafygreen-ui-1l06pbn"> saslauthd </code> , as in the following example: </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.getSiblingDB(\"$external\").auth(\n {\n mechanism: \"PLAIN\",\n user: &lt;username&gt;,\n pwd: passwordPrompt() // or cleartext password\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<span class="lg-highlight-string">"$external"</span>).<span class="lg-highlight-title lg-highlight-function">auth</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">mechanism</span>: <span class="lg-highlight-string">"PLAIN"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">user</span>: &lt;<!-- -->username<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pwd</span>: <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->) <span class="lg-highlight-comment">// or cleartext password</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Enter the password when prompted. </p> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The server forwards the password in plain text. In general, use only on a trusted channel (VPN, TLS/SSL, trusted wired network). See Considerations. </p> </section> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/configure-encryption/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Configure Encryption <a class="headerlink leafygreen-ui-1kepx47" href="#configure-encryption" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="configure-encryption"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#overview" target="_self"> <span> Overview </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#key-manager" target="_self"> <span> Key Manager </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#local-key-management" target="_self"> <span> Local Key Management </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#encrypt-existing-data-at-rest" target="_self"> <span> Encrypt Existing Data at Rest </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Overview <a class="headerlink leafygreen-ui-1kepx47" href="#overview" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="overview"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This page discusses server configuration to support encryption at rest. If you use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/atlas/database?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> , your data is already encrypted. MongoDB manages Atlas encryption at the cloud provider level, but you can also use your own key management solution. See the Atlas <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://docs.atlas.mongodb.com/security-kms-encryption/" target="_self"> <span> key management documentation </span> </a> for details. </p> <p class="leafygreen-ui-1kp3ins"> MongoDB Enterprise 3.2 introduces a native encryption option for the WiredTiger storage engine. Outside Atlas, encryption is only available for enterprise installations that use the WiredTiger Storage Engine. </p> <p class="leafygreen-ui-1kp3ins"> Secure management of the encryption keys is a critical requirement for storage encryption. MongoDB uses a master key that is not stored with the MongoDB installation. Only the master key is externally managed, other keys can be stored with your MongoDB instance. </p> <p class="leafygreen-ui-1kp3ins"> MongoDB's encrypted storage engine supports two key management options for the master key: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Integration with a third party key management appliance via the Key Management Interoperability Protocol (KMIP). <strong> Recommended </strong> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use of local key management via a keyfile. </p> </li> </ul> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB cannot encrypt existing data. When you enable encryption with a new key, the MongoDB instance cannot have any pre-existing data. If your MongoDB installation already has existing data, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-encrypt-existing-data" target="_self"> <span> Encrypt Existing Data at Rest </span> </a> for additional steps. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Key Manager <a class="headerlink leafygreen-ui-1kepx47" href="#key-manager" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="key-manager"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> MongoDB Enterprise supports secure transfer of keys with compatible key management appliances. Using a key manager allows for the keys to be stored in the key manager. </p> <p class="leafygreen-ui-1kp3ins"> MongoDB Enterprise supports secure transfer of keys with Key Management Interoperability Protocol (KMIP) compliant key management appliances. </p> <p class="leafygreen-ui-1kp3ins"> For a list of MongoDB's certified partners, refer to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/partners/list" target="_self"> <span> Partners List </span> </a> . </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Recommended </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Using a key manager meets regulatory key management guidelines, such as HIPAA, PCI-DSS, and FERPA, and is recommended over the local key management. </p> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Prerequisites <a class="headerlink leafygreen-ui-1kepx47" href="#prerequisites" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="prerequisites"> </div> </a> </h3> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your key manager must support the KMIP communication protocol. </p> <p class="leafygreen-ui-1kp3ins"> The default KMIP protocol version is 1.2. You can configure MongoDB to use KMIP version 1.0 or 1.1 in the MongoDB server <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#std-label-configuration-options"> configuration file <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For an integration with a third-party key management appliance using the <span class="leafygreen-ui-vm4wms" tabindex="0"> KMIP </span> , you should allow the following KMIP operations: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create ( <code class="leafygreen-ui-1l06pbn"> operation_create </code> ) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Get ( <code class="leafygreen-ui-1l06pbn"> operation_get </code> ) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Activate ( <code class="leafygreen-ui-1l06pbn"> operation_activate </code> ) </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To authenticate MongoDB to a KMIP server, you must have a valid certificate issued by the key management appliance. </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB Enterprise on Windows no longer supports <code class="leafygreen-ui-1l06pbn"> AES256-GCM </code> as a block cipher for encryption at rest. This usage is only supported on Linux. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-encrypt-with-new-key"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Encrypt Using a New Key <a class="headerlink leafygreen-ui-1kepx47" href="#encrypt-using-a-new-key" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="encrypt-using-a-new-key"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To create a new key when you connect to the key manager, use the following options to start <code class="leafygreen-ui-1l06pbn"> mongod </code> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--enableEncryption"> <code class="leafygreen-ui-1l06pbn"> --enableEncryption </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipServerName"> <code class="leafygreen-ui-1l06pbn"> --kmipServerName </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipPort"> <code class="leafygreen-ui-1l06pbn"> --kmipPort </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipServerCAFile"> <code class="leafygreen-ui-1l06pbn"> --kmipServerCAFile </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipClientCertificateFile"> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateFile </code> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> To connect to a version 1.0 or 1.1 KMIP server, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipUseLegacyProtocol"> <code class="leafygreen-ui-1l06pbn"> --kmipUseLegacyProtocol </code> </a> option. </p> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> . </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Enabling encryption using a KMIP server on Windows fails when using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipClientCertificateFile"> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateFile </code> </a> and the KMIP server enforces TLS 1.2. </p> <p class="leafygreen-ui-1kp3ins"> To enable encryption at rest with KMIP on Windows, you must: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Import the client certificate into the Windows Certificate Store. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipClientCertificateSelector"> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateSelector </code> </a> option. </p> </li> </ul> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation creates a new master key in your key manager. <code class="leafygreen-ui-1l06pbn"> mongod </code> uses the master key to encrypt the keys that <code class="leafygreen-ui-1l06pbn"> mongod </code> generates for each database. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --enableEncryption \\\n --kmipServerName &lt;kmip&gt; \\\n --kmipPort &lt;kmip&gt; \\\n --kmipServerCAFile ca.pem \\\n --kmipClientCertificateFile client.pem","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --enableEncryption \</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> --kmipServerName &lt;KMIP Server HostName&gt; \</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> --kmipPort &lt;KMIP server port&gt; \</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> --kmipServerCAFile ca.pem \</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> --kmipClientCertificateFile client.pem</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> mongod </code> verifies the connection to the KMIP server on startup. </p> <p class="leafygreen-ui-1kp3ins"> The server name specified in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipServerName"> <code class="leafygreen-ui-1l06pbn"> --kmipServerName </code> </a> must match either the Subject Alternative Name <code class="leafygreen-ui-1l06pbn"> SAN </code> or the Common Name <code class="leafygreen-ui-1l06pbn"> CN </code> on the certificate presented by the KMIP server. <code class="leafygreen-ui-1l06pbn"> SAN </code> can be a system name or an IP address. </p> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> SAN </code> is present, <code class="leafygreen-ui-1l06pbn"> mongod </code> does not try to match against <code class="leafygreen-ui-1l06pbn"> CN </code> . </p> <p class="leafygreen-ui-1kp3ins"> If the hostname or IP address of the KMIP server does does not match either <code class="leafygreen-ui-1l06pbn"> SAN </code> or <code class="leafygreen-ui-1l06pbn"> CN </code> , <code class="leafygreen-ui-1l06pbn"> mongod </code> does not start. </p> <p class="leafygreen-ui-1kp3ins"> To verify that the key creation and usage was successful, check the log file. If successful, the process will log the following messages: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[initandlisten] Created KMIP key with id: &lt;uid&gt;\n[initandlisten] Encryption key manager initialized using master key with id: &lt;uid&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[initandlisten] Created KMIP key with <span class="lg-highlight-built_in">id</span>: &lt;UID&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">[initandlisten] Encryption key manager initialized using master key with <span class="lg-highlight-built_in">id</span>: &lt;UID&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-label-encryption-key-management-options"> Encryption Key Management Options </a> </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-encrypt-with-existing-key"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Encrypt Using an Existing Key <a class="headerlink leafygreen-ui-1kepx47" href="#encrypt-using-an-existing-key" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="encrypt-using-an-existing-key"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can use an existing master key that your KMIP server already manages. To use an existing key, use these options when you start <code class="leafygreen-ui-1l06pbn"> mongod </code> to connect <code class="leafygreen-ui-1l06pbn"> mongod </code> to the key manager: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--enableEncryption"> <code class="leafygreen-ui-1l06pbn"> --enableEncryption </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipServerName"> <code class="leafygreen-ui-1l06pbn"> --kmipServerName </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipPort"> <code class="leafygreen-ui-1l06pbn"> --kmipPort </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipServerCAFile"> <code class="leafygreen-ui-1l06pbn"> --kmipServerCAFile </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipClientCertificateFile"> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateFile </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipKeyIdentifier"> <code class="leafygreen-ui-1l06pbn"> --kmipKeyIdentifier </code> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> To connect to a version 1.0 or 1.1 KMIP server, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipUseLegacyProtocol"> <code class="leafygreen-ui-1l06pbn"> --kmipUseLegacyProtocol </code> </a> option. </p> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --enableEncryption \\\n --kmipServerName &lt;kmip&gt; \\\n --kmipPort &lt;kmip&gt; \\\n --kmipServerCAFile ca.pem \\\n --kmipClientCertificateFile client.pem \\\n --kmipKeyIdentifier &lt;uid&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --enableEncryption \</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> --kmipServerName &lt;KMIP Server HostName&gt; \</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> --kmipPort &lt;KMIP server port&gt; \</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> --kmipServerCAFile ca.pem \</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> --kmipClientCertificateFile client.pem \</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> --kmipKeyIdentifier &lt;UID&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> mongod </code> verifies the connection to the KMIP server on startup. </p> <p class="leafygreen-ui-1kp3ins"> The server name specified in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipServerName"> <code class="leafygreen-ui-1l06pbn"> --kmipServerName </code> </a> must match either the Subject Alternative Name <code class="leafygreen-ui-1l06pbn"> SAN </code> or the Common Name <code class="leafygreen-ui-1l06pbn"> CN </code> on the certificate presented by the KMIP server. <code class="leafygreen-ui-1l06pbn"> SAN </code> can be a system name or an IP address. </p> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> SAN </code> is present, <code class="leafygreen-ui-1l06pbn"> mongod </code> does not try to match against <code class="leafygreen-ui-1l06pbn"> CN </code> . </p> <p class="leafygreen-ui-1kp3ins"> If the hostname or IP address of the KMIP server does does not match either <code class="leafygreen-ui-1l06pbn"> SAN </code> or <code class="leafygreen-ui-1l06pbn"> CN </code> , <code class="leafygreen-ui-1l06pbn"> mongod </code> does not start. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-label-encryption-key-management-options"> Encryption Key Management Options </a> </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-encrypt-local-key-mgmt"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Local Key Management <a class="headerlink leafygreen-ui-1kepx47" href="#local-key-management" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="local-key-management"> </div> </a> </h2> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Using the keyfile method does not meet most regulatory key management guidelines and requires users to securely manage their own keys. </p> <p class="leafygreen-ui-1kp3ins"> The safe management of the keyfile is critical. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> To encrypt using a keyfile, you must have a base64 encoded keyfile that contains a single 16 or 32 character string. The keyfile must only be accessible by the owner of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process. </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create the base64 encoded keyfile with the 16 or 32 character string. You can generate the encoded keyfile using any method you prefer. For example, </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"openssl rand -base64 32 &gt; mongodb-keyfile","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">openssl rand -<span class="lg-highlight-built_in">base64</span> 32 &gt; mongodb-keyfile</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Update the file permissions. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"chmod 600 mongodb-keyfile","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-built_in">chmod</span> 600 mongodb-keyfile</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To use the key file, start <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> with the following options: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> --enableEncryption </code> , </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> --encryptionKeyFile &lt;path to keyfile&gt; </code> , </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --enableEncryption --encryptionKeyFile mongodb-keyfile","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --enableEncryption --encryptionKeyFile mongodb-keyfile</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Verify if the encryption key manager successfully initialized with the keyfile. If the operation was successful, the process will log the following message: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[initandlisten] Encryption key manager initialized with key file: &lt;path&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[initandlisten] Encryption key manager initialized with key file: &lt;path to keyfile&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ol> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-label-encryption-key-management-options"> Encryption Key Management Options </a> </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-encrypt-existing-data"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Encrypt Existing Data at Rest <a class="headerlink leafygreen-ui-1kepx47" href="#encrypt-existing-data-at-rest" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="encrypt-existing-data-at-rest"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> MongoDB cannot encrypt existing data. When you enable encryption with a new key, the MongoDB instance cannot have any pre-existing data. </p> <p class="leafygreen-ui-1kp3ins"> If you are using a replica set that does have existing data, use a rolling <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-sync/#std-label-replica-set-initial-sync"> initial sync </a> to encrypt the data. </p> <p class="leafygreen-ui-1kp3ins"> For example, consider a replica set with three members. The replica set is in use and holds data that you want to encrypt. These are the steps you would take to encrypt the data at rest: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Prepare a server.Follow these steps to prepare the server:Pick one of the secondary servers.Stop mongod on the secondary server.Optional: Backup the data in dbPath. If a full\nbackup is not required, consider backing up just the\ndiagnostic.data directory to preserve potentially-useful\ntroubleshooting data in the event of an issue. See Full Time\nDiagnostic Data Capture for more information.Remove the files and directories in the\ndbPath."},{"@type":"HowToStep","text":"Enable encryption.Start the secondary server with encryption enabled. The mongod instance creates\na new keystore."},{"@type":"HowToStep","text":"Synchronize the data.Import the data from the primary. Start the mongod process, specifying\nReplication Options as appropriate.mongod performs an initial sync and encrypts the data\nduring the sync up process."},{"@type":"HowToStep","text":"Repeat the process on the secondaries.When the first secondary has finished importing and encrypting the\ndata, repeat the process on the other secondary\nmongod instances."},{"@type":"HowToStep","text":"Encrypt the primary.When the all the secondaries have been encrypted, step down the primary. Eligible secondaries will elect a new\nprimary.The old primary is now a secondary. Repeat the steps to remove the\nunencrypted data and then run an initial sync."}],"name":"Encrypt Existing Data at Rest","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Prepare a server. <a class="headerlink leafygreen-ui-1kepx47" href="#prepare-a-server" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="prepare-a-server"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Follow these steps to prepare the server: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Pick one of the secondary servers. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Stop <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> on the secondary server. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Optional: Backup the data in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> dbPath </code> </a> . If a full backup is not required, consider backing up just the <code class="leafygreen-ui-1l06pbn"> diagnostic.data </code> directory to preserve potentially-useful troubleshooting data in the event of an issue. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/full-time-diagnostic-data-capture/#std-label-ftdc-stub"> Full Time Diagnostic Data Capture </a> for more information. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Remove the files and directories in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> dbPath </code> . </a> </p> </li> </ul> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Enable encryption. <a class="headerlink leafygreen-ui-1kepx47" href="#enable-encryption" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="enable-encryption"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Start the secondary server with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-encrypt-with-new-key" target="_self"> <span> encryption enabled </span> </a> . The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance creates a new keystore. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Synchronize the data. <a class="headerlink leafygreen-ui-1kepx47" href="#synchronize-the-data" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="synchronize-the-data"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Import the data from the primary. <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-mongodb-processes/"> Start the mongod process </a> , specifying <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-label-cli-mongod-replica-set"> Replication Options </a> as appropriate. </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> performs an initial sync and encrypts the data during the sync up process. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Repeat the process on the secondaries. <a class="headerlink leafygreen-ui-1kepx47" href="#repeat-the-process-on-the-secondaries" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="repeat-the-process-on-the-secondaries"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When the first secondary has finished importing and encrypting the data, repeat the process on the other secondary <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Encrypt the primary. <a class="headerlink leafygreen-ui-1kepx47" href="#encrypt-the-primary" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="encrypt-the-primary"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When the all the secondaries have been encrypted, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.stepDown/#mongodb-method-rs.stepDown"> <code class="leafygreen-ui-1l06pbn"> step down </code> </a> the primary. Eligible secondaries will elect a new primary. </p> <p class="leafygreen-ui-1kp3ins"> The old primary is now a secondary. Repeat the steps to remove the unencrypted data and then run an <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-sync/#std-label-replica-set-initial-sync"> initial sync <!-- --> . </a> </p> </section> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/acos/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $acos (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-acos--aggregation-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-acos--aggregation-"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $acos </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-acos" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-expression-exp.-acos"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns the inverse cosine (arc cosine) of a value. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-acos" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $acos </code> </span> </a> has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $acos: &lt;expression&gt; }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$acos</span>: &lt;<!-- -->expression<!-- -->&gt; <!-- -->}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-acos" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $acos </code> </span> </a> takes any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a number between <code class="leafygreen-ui-1l06pbn"> -1 </code> and <code class="leafygreen-ui-1l06pbn"> 1 </code> , e.g. <code class="leafygreen-ui-1l06pbn"> -1 &lt;= value &lt;= 1 </code> . </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-acos" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $acos </code> </span> </a> returns values in radians. Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/radiansToDegrees/#mongodb-expression-exp.-radiansToDegrees"> <code class="leafygreen-ui-1l06pbn"> $radiansToDegrees </code> </a> operator to convert the output value from radians to degrees. </p> <p class="leafygreen-ui-1kp3ins"> By default <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-acos" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $acos </code> </span> </a> returns values as a <code class="leafygreen-ui-1l06pbn"> double </code> . <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-acos" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $acos </code> </span> </a> can also return values as a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/data-types/#std-label-shell-type-decimal" target="_self"> <span> 128-bit decimal </span> </a> as long as the <code class="leafygreen-ui-1l06pbn"> &lt;expression&gt; </code> resolves to a 128-bit decimal value. </p> <p class="leafygreen-ui-1kp3ins"> For more information on expressions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> Expression Operators <!-- --> . </a> </p> </dd> </dl> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If the argument resolves to a value of <code class="leafygreen-ui-1l06pbn"> null </code> or refers to a field that is missing, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-acos" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $acos </code> </span> </a> returns <code class="leafygreen-ui-1l06pbn"> null </code> . If the argument resolves to <code class="leafygreen-ui-1l06pbn"> NaN </code> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-acos" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $acos </code> </span> </a> returns <code class="leafygreen-ui-1l06pbn"> NaN </code> . If the argument resolves to a value outside the bounds of <code class="leafygreen-ui-1l06pbn"> [-1, 1] </code> inclusive, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-acos" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $acos </code> </span> </a> throws an error. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:85%"/> <col style="width:15%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Results </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $acos: NaN } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> NaN </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $acos: null } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> null </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> { $acos : Infinity} </code> </p> <p class="leafygreen-ui-1kp3ins"> <em> or </em> </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> { $acos : -Infinity } </code> </p> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Throws an error message resembling the following formatted output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"errmsg\" :\n \"Failed to optimize pipeline :: caused by :: cannot\n apply $acos to -inf, value must in [-1,1]\"","programmingLanguage":"Bash"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string">"errmsg"</span> :</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"Failed to optimize pipeline :: caused by :: cannot</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string"> apply </span><span class="lg-highlight-variable lg-highlight-string">$acos</span><span class="lg-highlight-string"> to -inf, value must in [-1,1]"</span></td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-7"> <div aria-label="Tabs to describe usage of degrees/radians" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_9asrhxth3" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_qqavg0lan" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Inverse Cosine of Value in Degrees </div> </button> <button aria-controls="_ko5ma0cgn" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_3tik6dprr" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Inverse Cosine of Value in Radians </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_vsuctk3jl" class="" id="_cfihqoumh" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> trigonometry </code> collection contains a document that stores three sides of a right-angle triangle: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : ObjectId(\"5c50782193f833234ba90d85\"),\n \"side_a\" : NumberDecimal(\"3\"),\n \"side_b\" : NumberDecimal(\"4\"),\n \"hypotenuse\" : NumberDecimal(\"5\")\n}","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> : ObjectId(<span class="lg-highlight-string">"5c50782193f833234ba90d85"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"side_a"</span> : NumberDecimal(<span class="lg-highlight-string">"3"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"side_b"</span> : NumberDecimal(<span class="lg-highlight-string">"4"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"hypotenuse"</span> : NumberDecimal(<span class="lg-highlight-string">"5"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following aggregation operation uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-acos" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $acos </code> </span> </a> expression to calculate the angle adjacent to <code class="leafygreen-ui-1l06pbn"> side_a </code> and add it to the input document using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/addFields/#mongodb-pipeline-pipe.-addFields"> <code class="leafygreen-ui-1l06pbn"> $addFields </code> </a> pipeline stage. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.trigonometry.aggregate([\n {\n $addFields : {\n \"angle_a\" : {\n $radiansToDegrees : {\n $acos : {\n $divide : [ \"$side_b\", \"$hypotenuse\" ]\n }\n }\n }\n }\n }\n])","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.trigonometry.aggregate([</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-variable">$addFields</span> : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"angle_a"</span> : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-variable">$radiansToDegrees</span> : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-variable">$acos</span> : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-variable">$divide</span> : [ <span class="lg-highlight-string">"</span><span class="lg-highlight-variable lg-highlight-string">$side_b</span><span class="lg-highlight-string">"</span>, <span class="lg-highlight-string">"</span><span class="lg-highlight-variable lg-highlight-string">$hypotenuse</span><span class="lg-highlight-string">"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/radiansToDegrees/#mongodb-expression-exp.-radiansToDegrees"> <code class="leafygreen-ui-1l06pbn"> $radiansToDegrees </code> </a> expression converts the radian value returned by <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-acos" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $acos </code> </span> </a> to the equivalent value in degrees. </p> <p class="leafygreen-ui-1kp3ins"> The command returns the following output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : ObjectId(\"5c50782193f833234ba90d85\"),\n \"side_a\" : NumberDecimal(\"3\"),\n \"side_b\" : NumberDecimal(\"4\"),\n \"hypotenuse\" : NumberDecimal(\"5\"),\n \"angle_a\" : NumberDecimal(\"36.86989764584402129685561255909341\")\n}","programmingLanguage":"Bash"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> : ObjectId(<span class="lg-highlight-string">"5c50782193f833234ba90d85"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"side_a"</span> : NumberDecimal(<span class="lg-highlight-string">"3"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"side_b"</span> : NumberDecimal(<span class="lg-highlight-string">"4"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"hypotenuse"</span> : NumberDecimal(<span class="lg-highlight-string">"5"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"angle_a"</span> : NumberDecimal(<span class="lg-highlight-string">"36.86989764584402129685561255909341"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Since <code class="leafygreen-ui-1l06pbn"> side_b </code> and <code class="leafygreen-ui-1l06pbn"> hypotenuse </code> are stored as <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/data-types/#std-label-shell-type-decimal" target="_self"> <span> 128-bit decimals </span> </a> , the output of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-acos" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $acos </code> </span> </a> is a 128-bit decimal. </p> </div> </div> </div> <div> <div aria-labelledby="_6v1mjzj8n" class="leafygreen-ui-38lglc" id="_n0hrlw9gs" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> trigonometry </code> collection contains a document that stores three sides of a right-angle triangle: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : ObjectId(\"5c50782193f833234ba90d85\"),\n \"side_a\" : NumberDecimal(\"3\"),\n \"side_b\" : NumberDecimal(\"4\"),\n \"hypotenuse\" : NumberDecimal(\"5\")\n}","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> : ObjectId(<span class="lg-highlight-string">"5c50782193f833234ba90d85"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"side_a"</span> : NumberDecimal(<span class="lg-highlight-string">"3"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"side_b"</span> : NumberDecimal(<span class="lg-highlight-string">"4"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"hypotenuse"</span> : NumberDecimal(<span class="lg-highlight-string">"5"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following aggregation operation uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-acos" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $acos </code> </span> </a> expression to calculate the angle adjacent to <code class="leafygreen-ui-1l06pbn"> side_a </code> and add it to the input document using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/addFields/#mongodb-pipeline-pipe.-addFields"> <code class="leafygreen-ui-1l06pbn"> $addFields </code> </a> pipeline stage. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.trigonometry.aggregate([\n {\n $addFields : {\n \"angle_a\" : {\n $acos : {\n $divide : [ \"$side_b\", \"$hypotenuse\" ]\n }\n }\n }\n }\n])","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.trigonometry.aggregate([</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-variable">$addFields</span> : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"angle_a"</span> : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-variable">$acos</span> : {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-variable">$divide</span> : [ <span class="lg-highlight-string">"</span><span class="lg-highlight-variable lg-highlight-string">$side_b</span><span class="lg-highlight-string">"</span>, <span class="lg-highlight-string">"</span><span class="lg-highlight-variable lg-highlight-string">$hypotenuse</span><span class="lg-highlight-string">"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The command returns the following output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : ObjectId(\"5c50782193f833234ba90d85\"),\n \"side_a\" : NumberDecimal(\"3\"),\n \"side_b\" : NumberDecimal(\"4\"),\n \"hypotenuse\" : NumberDecimal(\"5\"),\n \"angle_a\" : NumberDecimal(\"0.6435011087932843868028092287173226\")\n}","programmingLanguage":"Bash"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> : ObjectId(<span class="lg-highlight-string">"5c50782193f833234ba90d85"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"side_a"</span> : NumberDecimal(<span class="lg-highlight-string">"3"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"side_b"</span> : NumberDecimal(<span class="lg-highlight-string">"4"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"hypotenuse"</span> : NumberDecimal(<span class="lg-highlight-string">"5"</span>),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"angle_a"</span> : NumberDecimal(<span class="lg-highlight-string">"0.6435011087932843868028092287173226"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Since <code class="leafygreen-ui-1l06pbn"> side_b </code> and <code class="leafygreen-ui-1l06pbn"> hypotenuse </code> are stored as <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/data-types/#std-label-shell-type-decimal" target="_self"> <span> 128-bit decimals </span> </a> , the output of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-acos" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $acos </code> </span> </a> is a 128-bit decimal. </p> </div> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/projection/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Projection Operators <a class="headerlink leafygreen-ui-1kepx47" href="#projection-operators" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="projection-operators"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> Projection operators specify the fields returned by an operation. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find() </code> </a> operations on views do not support the following <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-projection-operators-top"> Query and Projection Operators </a> operators: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/projection/positional/#mongodb-projection-proj.-"> <code class="leafygreen-ui-1l06pbn"> $ </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/projection/elemMatch/#mongodb-projection-proj.-elemMatch"> <code class="leafygreen-ui-1l06pbn"> $elemMatch </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/projection/slice/#mongodb-projection-proj.-slice"> <code class="leafygreen-ui-1l06pbn"> $slice </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/meta/#mongodb-expression-exp.-meta"> <code class="leafygreen-ui-1l06pbn"> $meta </code> </a> </p> </li> </ul> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For details on a specific operator, including syntax and examples, click on the link to the operator's reference page. </p> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/projection/positional/#mongodb-projection-proj.-"> <code class="leafygreen-ui-1l06pbn"> $ </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Projects the first element in an array that matches the query condition. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/projection/elemMatch/#mongodb-projection-proj.-elemMatch"> <code class="leafygreen-ui-1l06pbn"> $elemMatch </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Projects the first element in an array that matches the specified <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/projection/elemMatch/#mongodb-projection-proj.-elemMatch"> <code class="leafygreen-ui-1l06pbn"> $elemMatch </code> </a> condition. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/meta/#mongodb-expression-exp.-meta"> <code class="leafygreen-ui-1l06pbn"> $meta </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Projects the available per-document metadata. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/projection/slice/#mongodb-projection-proj.-slice"> <code class="leafygreen-ui-1l06pbn"> $slice </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Limits the number of elements projected from an array. Supports skip and limit slices. </div> </div> </td> </tr> </tbody> </table> </div> </section>
https://www.mongodb.com/docs/manual/tutorial/expire-data/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Expire Data from Collections by Setting TTL <a class="headerlink leafygreen-ui-1kepx47" href="#expire-data-from-collections-by-setting-ttl" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="expire-data-from-collections-by-setting-ttl"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#expire-documents-in-the-mongodb-atlas-ui" target="_self"> <span> Expire Documents in the MongoDB Atlas UI </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#expire-documents-after-a-specified-number-of-seconds" target="_self"> <span> Expire Documents after a Specified Number of Seconds </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#expire-documents-with-filter-conditions" target="_self"> <span> Expire Documents with Filter Conditions </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#expire-documents-at-a-specific-clock-time" target="_self"> <span> Expire Documents at a Specific Clock Time </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#indexes-configured-using-nan" target="_self"> <span> Indexes Configured Using NaN </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> This document provides an introduction to MongoDB's " <em> time to live </em> " or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-TTL"> TTL </a> collection feature. TTL collections make it possible to store data in MongoDB and have the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> automatically remove data after a specified number of seconds or at a specific clock time. </p> <p class="leafygreen-ui-1kp3ins"> You can expire data for deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Data expiration is useful for some classes of information, including machine generated event data, logs, and session information that only need to persist for a limited period of time. </p> <p class="leafygreen-ui-1kp3ins"> A special <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-ttl/#std-label-index-feature-ttl"> TTL index property </a> supports the implementation of TTL collections. The TTL feature relies on a background thread in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> that reads the date-typed values in the index and removes expired <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-document"> documents </a> from the collection. </p> <p class="leafygreen-ui-1kp3ins"> To create a TTL index, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex"> <code class="leafygreen-ui-1l06pbn"> createIndex() </code> </a> . Specify an index field that is either a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-date"> date type </a> or an array that contains date type values. Use the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> option to specify a TTL value in seconds. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The TTL index is a single field index. Compound indexes do not support the TTL property. For more information on TTL indexes, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-ttl/#std-label-index-feature-ttl"> TTL Indexes <!-- --> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> You can modify the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> of an existing TTL index using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> command. </p> <p class="leafygreen-ui-1kp3ins"> If a time series collection contains documents with <code class="leafygreen-ui-1l06pbn"> timeField </code> timestamps before <code class="leafygreen-ui-1l06pbn"> 1970-01-01T00:00:00.000Z </code> or after <code class="leafygreen-ui-1l06pbn"> 2038-01-19T03:14:07.000Z </code> , no documents are deleted from the collection by the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-TTL"> TTL "time to live" </a> feature. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-expire-data-atlas-ui"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Expire Documents in the MongoDB Atlas UI <a class="headerlink leafygreen-ui-1kepx47" href="#expire-documents-in-the-mongodb-atlas-ui" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="expire-documents-in-the-mongodb-atlas-ui"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To expire data in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-ui/#std-label-atlas-ui-overview" target="_self"> <span> Atlas UI </span> </a> , follow these steps: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"If it's not already displayed, select the organization that\ncontains your desired project from the Organizations menu in the\nnavigation bar.If it's not already displayed, select your project\nfrom the Projects menu in the navigation bar.If it's not already displayed, click Clusters in the\nsidebar.The Clusters page displays.","name":"In the MongoDB Atlas UI, go to the Clusters page for your project."},{"@type":"HowToStep","text":"For the cluster that contains the data you want to\nexpire, click Browse Collections.In the left navigation pane, select the database.In the left navigation pane, select the collection.","name":"Navigate to the collection"},{"@type":"HowToStep","text":"Click the Indexes tab.Click Create Index.","name":"Open the Create Index modal"},{"@type":"HowToStep","text":"In the Fields section, enter the index key\nspecification document. For this example, enter the\nfollowing text to create an index on the\nexpiresAfter field:In the Options section, enter the\nexpireAfterSeconds option. For this example, enter the\nfollowing text to expire the data 1 second after the\nexpiresAfter field's value:Click Review.Click Confirm.","name":"Create the index with the expiresAfterSeconds option"},{"@type":"HowToStep","text":"In the left navigation pane, select the collection that\ncontains the index.Click the Find tab.Click Insert Document.Click the text field under the _id field and enter\nthe field name expiresAfter.Click the text field next to expiresAfter and enter the\nfollowing value:This value expires data after 12:00 on October\n1, 2023.Click the data type drop-down menu and change the data type\nvalue to Date.Click Insert.The document will expire automatically one second after the\nexpiredAfter field's value.The TTL index may take 1-2 seconds to expire the document.\nYou may need to refresh the UI to see that MongoDB Atlas deletes\nthe expired document.","name":"Add a document that contains the expiresAfter field to the collection"}],"name":"Expire Documents in the MongoDB Atlas UI","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> In the MongoDB Atlas UI, go to the <span class="guilabel css-h15tq0"> Clusters </span> page for your project. <a class="headerlink leafygreen-ui-1kepx47" href="#in-the-mongodb-atlas-ui--go-to-the-clusters-page-for-your-project." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="in-the-mongodb-atlas-ui--go-to-the-clusters-page-for-your-project."> </div> </a> </h3> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If it's not already displayed, select the organization that contains your desired project from the <i class="mms-icon-office mms-icon"> </i> <span class="guilabel css-h15tq0"> Organizations </span> menu <!-- --> in the navigation bar. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If it's not already displayed, select your project from the <span class="guilabel css-h15tq0"> Projects </span> menu in the navigation bar. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If it's not already displayed, click <span class="guilabel css-h15tq0"> Clusters </span> in the sidebar. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://cloud.mongodb.com/go?l=https%3A%2F%2Fcloud.mongodb.com%2Fv2%2F%3Cproject%3E%23%2Fclusters" target="_self"> <span> Clusters </span> </a> page displays. </p> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Navigate to the collection <a class="headerlink leafygreen-ui-1kepx47" href="#navigate-to-the-collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="navigate-to-the-collection"> </div> </a> </h3> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For the cluster that contains the data you want to expire, click <span class="guilabel css-h15tq0"> Browse Collections </span> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In the left navigation pane, select the database. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In the left navigation pane, select the collection. </p> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Open the <span class="guilabel css-h15tq0"> Create Index </span> modal <a class="headerlink leafygreen-ui-1kepx47" href="#open-the-create-index-modal" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="open-the-create-index-modal"> </div> </a> </h3> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click the <span class="guilabel css-h15tq0"> Indexes </span> tab. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click <span class="guilabel css-h15tq0"> Create Index </span> . </p> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create the index with the <code class="leafygreen-ui-1l06pbn"> expiresAfterSeconds </code> option <a class="headerlink leafygreen-ui-1kepx47" href="#create-the-index-with-the-expiresafterseconds-option" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-the-index-with-the-expiresafterseconds-option"> </div> </a> </h3> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In the <span class="guilabel css-h15tq0"> Fields </span> section, enter the index key specification document. For this example, enter the following text to create an index on the <code class="leafygreen-ui-1l06pbn"> expiresAfter </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"expiresAfter\": 1 }"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "expiresAfter": 1 }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In the <span class="guilabel css-h15tq0"> Options </span> section, enter the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> option. For this example, enter the following text to expire the data 1 second after the <code class="leafygreen-ui-1l06pbn"> expiresAfter </code> field's value: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ expireAfterSeconds: 1 }"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ expireAfterSeconds: 1 }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click <span class="guilabel css-h15tq0"> Review </span> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click <span class="guilabel css-h15tq0"> Confirm </span> . </p> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Add a document that contains the <code class="leafygreen-ui-1l06pbn"> expiresAfter </code> field to the collection <a class="headerlink leafygreen-ui-1kepx47" href="#add-a-document-that-contains-the-expiresafter-field-to-the-collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="add-a-document-that-contains-the-expiresafter-field-to-the-collection"> </div> </a> </h3> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In the left navigation pane, select the collection that contains the index. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click the <span class="guilabel css-h15tq0"> Find </span> tab. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click <span class="guilabel css-h15tq0"> Insert Document </span> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click the text field under the <span class="guilabel css-h15tq0"> _id </span> field and enter the field name <code class="leafygreen-ui-1l06pbn"> expiresAfter </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click the text field next to <code class="leafygreen-ui-1l06pbn"> expiresAfter </code> and enter the following value: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"2023-10-01T12:00:00.000+00:00"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">2023-10-01T12:00:00.000+00:00</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This value expires data after 12:00 on October 1, 2023. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click the data type drop-down menu and change the data type value to <span class="guilabel css-h15tq0"> Date </span> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Click <span class="guilabel css-h15tq0"> Insert </span> . </p> <p class="leafygreen-ui-1kp3ins"> The document will expire automatically one second after the <code class="leafygreen-ui-1l06pbn"> expiredAfter </code> field's value. </p> <p class="leafygreen-ui-1kp3ins"> The TTL index may take 1-2 seconds to expire the document. You may need to refresh the UI to see that MongoDB Atlas deletes the expired document. </p> </li> </ol> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Expire Documents after a Specified Number of Seconds <a class="headerlink leafygreen-ui-1kepx47" href="#expire-documents-after-a-specified-number-of-seconds" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="expire-documents-after-a-specified-number-of-seconds"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can expire data after a specified number of seconds in the terminal. To expire data after a specified number of seconds has passed since the indexed field, create a TTL index on a field that holds values of BSON date type or an array of BSON date-typed objects <em> and </em> specify a positive non-zero value in the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> field. A document will expire when the number of seconds in the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> field has passed since the time specified in its indexed field. <a class="footnote-reference header-buffer" href="#footnote-field-is-array-of-dates" id="ref-field-is-array-of-dates-id1"> [ <!-- --> 1 <!-- --> ] </a> </p> <p class="leafygreen-ui-1kp3ins"> The TTL index <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> value must be within <code class="leafygreen-ui-1l06pbn"> 0 </code> and <code class="leafygreen-ui-1l06pbn"> 2147483647 </code> inclusive. </p> <p class="leafygreen-ui-1kp3ins"> For example, the following operation creates an index on the <code class="leafygreen-ui-1l06pbn"> log_events </code> collection's <code class="leafygreen-ui-1l06pbn"> createdAt </code> field and specifies the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> value of <code class="leafygreen-ui-1l06pbn"> 10 </code> to set the expiration time to be ten seconds after the time specified by <code class="leafygreen-ui-1l06pbn"> createdAt </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.log_events.createIndex( { \"createdAt\": 1 }, { expireAfterSeconds: 10 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">log_events</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-string">"createdAt"</span>: <span class="lg-highlight-number">1</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">expireAfterSeconds</span>: <span class="lg-highlight-number">10</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> When adding documents to the <code class="leafygreen-ui-1l06pbn"> log_events </code> collection, set the <code class="leafygreen-ui-1l06pbn"> createdAt </code> field to the current time: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.log_events.insertOne( {\n \"createdAt\": new Date(),\n \"logEvent\": 2,\n \"logMessage\": \"Success!\"\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">log_events</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"createdAt"</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<!-- -->)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"logEvent"</span>: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"logMessage"</span>: <span class="lg-highlight-string">"Success!"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB will automatically delete documents from the <code class="leafygreen-ui-1l06pbn"> log_events </code> collection when the document's <code class="leafygreen-ui-1l06pbn"> createdAt </code> value <a class="footnote-reference header-buffer" href="#footnote-field-is-array-of-dates" id="ref-field-is-array-of-dates-id2"> [ <!-- --> 1 <!-- --> ] </a> is older than the number of seconds specified in <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> . </p> <table class="header-buffer leafygreen-ui-rbqgrl" frame="void" id="footnote-field-is-array-of-dates" rules="none"> <colgroup> <col/> </colgroup> <tbody valign="top"> <tr> <td class="leafygreen-ui-17r2xs0"> [ <!-- --> 1 <!-- --> ] </td> <td class="leafygreen-ui-17r2xs0"> <em> ( <a href="#ref-field-is-array-of-dates-id1"> 1 </a> , <a href="#ref-field-is-array-of-dates-id2"> 2 </a> ) </em> <!-- --> If the field contains an array of BSON date-typed objects, data expires if at least one of BSON date-typed object is older than the number of seconds specified in <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> . </td> </tr> </tbody> </table> <span class="leafygreen-ui-1qnjd6d" id="std-label-partial-ttl-index-example"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Expire Documents with Filter Conditions <a class="headerlink leafygreen-ui-1kepx47" href="#expire-documents-with-filter-conditions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="expire-documents-with-filter-conditions"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To expire documents with specific filter expressions, you can create an index that is both a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-partial/#std-label-index-type-partial"> partial </a> and a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-ttl/#std-label-index-feature-ttl"> TTL </a> index. </p> <p class="leafygreen-ui-1kp3ins"> Create a partial TTL index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.foo.createIndex(\n { F: 1 },\n {\n name: \"Partial-TTL-Index\",\n partialFilterExpression: { D : 1 },\n expireAfterSeconds: 10\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">foo</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">F</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">"Partial-TTL-Index"</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partialFilterExpression</span>: <!-- -->{ <!-- -->D <!-- -->: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">expireAfterSeconds</span>: <span class="lg-highlight-number">10</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Insert two documents, one of which matches the filter expression <code class="leafygreen-ui-1l06pbn"> { D : 1 } </code> of the <code class="leafygreen-ui-1l06pbn"> partialFilterExpression </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.foo.insertMany( [\n { \"F\" : ISODate(\"2019-03-07T20:59:18.428Z\"), \"D\" : 3},\n { \"F\" : ISODate(\"2019-03-07T20:59:18.428Z\"), \"D\" : 1}\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">foo</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"F"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-03-07T20:59:18.428Z"</span>)<!-- -->, <span class="lg-highlight-string">"D"</span> <!-- -->: <span class="lg-highlight-number">3</span>}<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"F"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-03-07T20:59:18.428Z"</span>)<!-- -->, <span class="lg-highlight-string">"D"</span> <!-- -->: <span class="lg-highlight-number">1</span>}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Wait for ten seconds then query the <code class="leafygreen-ui-1l06pbn"> foo </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.foo.find({}, {_id: 0, F: 1, D: 1})","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">foo</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->{<!-- -->}<!-- -->, <!-- -->{<span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">F</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">D</span>: <span class="lg-highlight-number">1</span>})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The document that matches the <code class="leafygreen-ui-1l06pbn"> partialFilterExpression </code> of <code class="leafygreen-ui-1l06pbn"> { D : 1 } </code> is deleted (expired). As a result, only one document remains in the <code class="leafygreen-ui-1l06pbn"> foo </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"F\" : ISODate(\"2019-03-07T20:59:18.428Z\"), \"D\" : 3}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"F"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-03-07T20:59:18.428Z"</span>)<!-- -->, <span class="lg-highlight-string">"D"</span> <!-- -->: <span class="lg-highlight-number">3</span>}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Expire Documents at a Specific Clock Time <a class="headerlink leafygreen-ui-1kepx47" href="#expire-documents-at-a-specific-clock-time" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="expire-documents-at-a-specific-clock-time"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can expire data at a specified clock time in the terminal. To expire documents at a specific clock time, begin by creating a TTL index on a field that holds values of BSON date type or an array of BSON date-typed objects <em> and </em> specify an <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> value of <code class="leafygreen-ui-1l06pbn"> 0 </code> . For each document in the collection, set the indexed date field to a value corresponding to the time the document should expire. If the indexed date field contains a date in the past, MongoDB considers the document expired. </p> <p class="leafygreen-ui-1kp3ins"> For example, the following operation creates an index on the <code class="leafygreen-ui-1l06pbn"> log_events </code> collection's <code class="leafygreen-ui-1l06pbn"> expireAt </code> field and specifies the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> value of <code class="leafygreen-ui-1l06pbn"> 0 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.log_events.createIndex( { \"expireAt\": 1 }, { expireAfterSeconds: 0 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">log_events</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-string">"expireAt"</span>: <span class="lg-highlight-number">1</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">expireAfterSeconds</span>: <span class="lg-highlight-number">0</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For each document, set the value of <code class="leafygreen-ui-1l06pbn"> expireAt </code> to correspond to the time the document should expire. For example, the following <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.insertOne/#mongodb-method-db.collection.insertOne"> <code class="leafygreen-ui-1l06pbn"> insertOne() </code> </a> operation adds a document that expires at <code class="leafygreen-ui-1l06pbn"> July 22, 2013 14:00:00 </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.log_events.insertOne( {\n \"expireAt\": new Date('July 22, 2013 14:00:00'),\n \"logEvent\": 2,\n \"logMessage\": \"Success!\"\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">log_events</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"expireAt"</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">'July 22, 2013 14:00:00'</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"logEvent"</span>: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"logMessage"</span>: <span class="lg-highlight-string">"Success!"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB will automatically delete documents from the <code class="leafygreen-ui-1l06pbn"> log_events </code> collection when the documents' <code class="leafygreen-ui-1l06pbn"> expireAt </code> value is older than the number of seconds specified in <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> , i.e. <code class="leafygreen-ui-1l06pbn"> 0 </code> seconds older in this case. As such, the data expires at the specified <code class="leafygreen-ui-1l06pbn"> expireAt </code> value. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-expireData-warning"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Indexes Configured Using NaN <a class="headerlink leafygreen-ui-1kepx47" href="#indexes-configured-using-nan" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="indexes-configured-using-nan"> </div> </a> </h2> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Possible Data Loss </p> <p class="leafygreen-ui-1kp3ins"> When a TTL index has <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> set to <code class="leafygreen-ui-1l06pbn"> NaN </code> , upgrade, downgrade, and certain syncing operations can lead to unexpected behavior and possible data loss. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Do not set <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> to <code class="leafygreen-ui-1l06pbn"> NaN </code> in your TTL index configuration. </p> <p class="leafygreen-ui-1kp3ins"> Prior to MongoDB 5.0, when a TTL index has <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> set to <code class="leafygreen-ui-1l06pbn"> NaN </code> , MongoDB logs an error and does not remove any records. </p> <p class="leafygreen-ui-1kp3ins"> From MongoDB 5.0.0 - 5.0.13 (and 6.0.0 - 6.0.1), <code class="leafygreen-ui-1l06pbn"> NaN </code> is treated as <code class="leafygreen-ui-1l06pbn"> 0 </code> . If a TTL index is configured with <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> set to <code class="leafygreen-ui-1l06pbn"> NaN </code> , all TTL-indexed documents expire immediately. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0.14 (and 6.0.2), the server will not use TTL indexes that have <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> set to <code class="leafygreen-ui-1l06pbn"> NaN </code> . </p> <p class="leafygreen-ui-1kp3ins"> However, there are still some situations which may result in unexpected behavior. Documents may expire: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> During an initial sync to an earlier version from MongoDB 5.0.0 - 5.0.13 (or 6.0.0 - 6.0.1). </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When upgrading from an earlier version to MongoDB 5.0.0 - 5.0.13. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When restoring a collection from a pre-5.0 <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongodump/#mongodb-binary-bin.mongodump" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongodump </code> </span> </a> into a MongoDB 5.0.0 - 5.0.13 (or 6.0.0 - 6.0.1) instance. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> To avoid problems, either drop or correct any misconfigured TTL indexes. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Run the following script in the mongosh shell. The\nscript does not work in the legacy mongo shell.","name":"Identify misconfigured indexes."},{"@type":"HowToStep","text":"Use the collMod command to update any misconfigured\nexpireAfterSeconds values that the script found.As an alternative, you can drop any\nmisconfigured TTL indexes and recreate them later using the\ncreateIndexes command.","name":"Correct misconfigured indexes."}],"name":"Indexes Configured Using NaN","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Identify misconfigured indexes. <a class="headerlink leafygreen-ui-1kepx47" href="#identify-misconfigured-indexes." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="identify-misconfigured-indexes."> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Run the following script in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> shell. The script does not work in the legacy <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"function getNaNIndexes() {\n const nan_index = [];\n\n const dbs = db.adminCommand({ listDatabases: 1 }).databases;\n\n dbs.forEach((d) =&gt; {\n if (d.name != 'local') {\n const listCollCursor = db\n .getSiblingDB(d.name)\n .runCommand({ listCollections: 1 }).cursor;\n\n const collDetails = {\n db: listCollCursor.ns.split(\".$cmd\")[0],\n colls: listCollCursor.firstBatch.map((c) =&gt; c.name),\n };\n\n collDetails.colls.forEach((c) =&gt;\n db\n .getSiblingDB(collDetails.db)\n .getCollection(c)\n .getIndexes()\n .forEach((entry) =&gt; {\n if (Object.is(entry.expireAfterSeconds, NaN)) {\n nan_index.push({ ns: `${collDetails.db}.${c}`, index: entry });\n }\n })\n );\n }\n });\n\n return nan_index;\n};\n\ngetNaNIndexes();","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword lg-highlight-function">function</span> <span class="lg-highlight-title lg-highlight-function">getNaNIndexes</span>(<!-- -->)<!-- --> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">const</span> nan_index <!-- -->= <!-- -->[<!-- -->]<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">const</span> dbs <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>(<!-- -->{ <span class="lg-highlight-attr">listDatabases</span>: <span class="lg-highlight-number">1</span> }).<span class="lg-highlight-property">databases</span>;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->dbs.<span class="lg-highlight-title lg-highlight-function">forEach</span>(<span class="lg-highlight-function">(</span><span class="lg-highlight-params lg-highlight-function">d</span><span class="lg-highlight-function">) =&gt;</span> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">if</span> <!-- -->(<!-- -->d.<span class="lg-highlight-property">name</span> <!-- -->!<!-- -->= <span class="lg-highlight-string">'local'</span>) <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">const</span> listCollCursor <!-- -->= <!-- -->db</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<!-- -->d.<span class="lg-highlight-property">name</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">runCommand</span>(<!-- -->{ <span class="lg-highlight-attr">listCollections</span>: <span class="lg-highlight-number">1</span> }).<span class="lg-highlight-property">cursor</span>;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">const</span> collDetails <!-- -->= <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">db</span>: <!-- -->listCollCursor.<span class="lg-highlight-property">ns</span>.<span class="lg-highlight-title lg-highlight-function">split</span>(<span class="lg-highlight-string">".$cmd"</span>)<!-- -->[<span class="lg-highlight-number">0</span>]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">colls</span>: <!-- -->listCollCursor.<span class="lg-highlight-property">firstBatch</span>.<span class="lg-highlight-title lg-highlight-function">map</span>(<span class="lg-highlight-function">(</span><span class="lg-highlight-params lg-highlight-function">c</span><span class="lg-highlight-function">) =&gt;</span> <!-- -->c.<span class="lg-highlight-property">name</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->collDetails.<span class="lg-highlight-property">colls</span>.<span class="lg-highlight-title lg-highlight-function">forEach</span>(<span class="lg-highlight-function">(</span><span class="lg-highlight-params lg-highlight-function">c</span><span class="lg-highlight-function">) =&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->db</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<!-- -->collDetails.<span class="lg-highlight-property">db</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">getCollection</span>(<!-- -->c)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">getIndexes</span>(<!-- -->)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> .<span class="lg-highlight-title lg-highlight-function">forEach</span>(<span class="lg-highlight-function">(</span><span class="lg-highlight-params lg-highlight-function">entry</span><span class="lg-highlight-function">) =&gt;</span> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">if</span> <!-- -->(<span class="lg-highlight-title lg-highlight-class">Object</span>.<span class="lg-highlight-title lg-highlight-function">is</span>(<!-- -->entry.<span class="lg-highlight-property">expireAfterSeconds</span>, <span class="lg-highlight-title lg-highlight-class">NaN</span>)) <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->nan_index.<span class="lg-highlight-title lg-highlight-function">push</span>(<!-- -->{ <span class="lg-highlight-attr">ns</span>: <span class="lg-highlight-string">`</span><span class="lg-highlight-subst lg-highlight-string">${collDetails.db}</span><span class="lg-highlight-string">.</span><span class="lg-highlight-subst lg-highlight-string">${c}</span><span class="lg-highlight-string">`</span>, <span class="lg-highlight-attr">index</span>: <!-- -->entry })<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> })</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> )<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> })<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">return</span> <!-- -->nan_index<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">getNaNIndexes</span>(<!-- -->)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Correct misconfigured indexes. <a class="headerlink leafygreen-ui-1kepx47" href="#correct-misconfigured-indexes." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="correct-misconfigured-indexes."> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> command to update any misconfigured <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> values that the script found. </p> <p class="leafygreen-ui-1kp3ins"> As an alternative, you can <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/dropIndexes/#mongodb-dbcommand-dbcmd.dropIndexes"> <code class="leafygreen-ui-1l06pbn"> drop </code> </a> any misconfigured TTL indexes and recreate them later using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createIndexes/#mongodb-dbcommand-dbcmd.createIndexes"> <code class="leafygreen-ui-1l06pbn"> createIndexes </code> </a> command. </p> </section> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/dbHash/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> dbHash <a class="headerlink leafygreen-ui-1kepx47" href="#dbhash" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="dbhash"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#command-fields" target="_self"> <span> Command Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#return-document" target="_self"> <span> Return Document </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> dbHash </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.dbHash" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-dbcommand-dbcmd.dbHash"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns the hash values of the collections in a database and an MD5 value for these collections. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.dbHash" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> dbHash </code> </span> </a> is useful to compare databases across <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances, such as across members of replica sets. </p> </dd> </dl> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.dbHash" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> dbHash </code> </span> </a> command obtains a shared (S) lock on the database, which prevents writes until the command completes. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is not supported in M0, M2, and M5 clusters or in serverless instances. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand(\n {\n dbHash: 1,\n collections: [ &lt;collection1&gt;, ... ]\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dbHash</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collections</span>: <!-- -->[ &lt;<!-- -->collection1<!-- -->&gt;<!-- -->,<!-- --> <!-- -->...<!-- --> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Command Fields <a class="headerlink leafygreen-ui-1kepx47" href="#command-fields" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="command-fields"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command takes the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> dbHash </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Any type </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The command to run. Specify any value. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> collections </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> array </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. An array of collection names. </p> <p class="leafygreen-ui-1kp3ins"> Either specify the collections for which to return the hash values, or omit or specify an empty array to return the hash values for all collections in the database. </p> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Non-Existent Collection <a class="headerlink leafygreen-ui-1kepx47" href="#non-existent-collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="non-existent-collection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If a collection in the <code class="leafygreen-ui-1l06pbn"> collections </code> array is non-existent, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.dbHash" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> dbHash </code> </span> </a> does not return a hash value for that collection. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Restrictions <a class="headerlink leafygreen-ui-1kepx47" href="#restrictions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="restrictions"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.dbHash" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> dbHash </code> </span> </a> command no longer support <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern/#std-label-afterClusterTime"> afterClusterTime </a> . As such, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.dbHash" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> dbHash </code> </span> </a> cannot be associated with <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-isolation-consistency-recency/#std-label-causal-consistency"> causally consistent sessions <!-- --> . </a> </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Return Document <a class="headerlink leafygreen-ui-1kepx47" href="#return-document" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="return-document"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command returns a document with the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> host </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The host and port of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance on which the command is run. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> collections </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> A document with the collections and their corresponding hash values. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n &lt;collection1&gt;: &lt;hash1&gt;,\n &lt;collection2&gt;: &lt;hash2&gt;,\n ...\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;<!-- -->collection1<!-- -->&gt;<!-- -->: &lt;<!-- -->hash1<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->&lt;<!-- -->collection2<!-- -->&gt;<!-- -->: &lt;<!-- -->hash2<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> capped </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An array that lists the capped collections. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> uuids </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> A document with the collections and their corresponding UUID values. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n &lt;collection1&gt;: &lt;uuid1&gt;,\n &lt;collection2&gt;: &lt;uuid2&gt;,\n ...\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;<!-- -->collection1<!-- -->&gt;<!-- -->: &lt;<span class="lg-highlight-title lg-highlight-class">UUID1</span>&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->&lt;<!-- -->collection2<!-- -->&gt;<!-- -->: &lt;<span class="lg-highlight-title lg-highlight-class">UUID2</span>&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> md5 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The aggregate hash value for these collections. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> timeMillis </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Number of milliseconds to generate the hash. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <code class="leafygreen-ui-1l06pbn"> ok </code> </div> <div class="line"> <code class="leafygreen-ui-1l06pbn"> operationTime </code> </div> <div class="line"> <code class="leafygreen-ui-1l06pbn"> $clusterTime </code> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returned with every command. See also <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.runCommand/#std-label-command-response"> Response </a> for details. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Return Hash Values for All Collections in a Database <a class="headerlink leafygreen-ui-1kepx47" href="#return-hash-values-for-all-collections-in-a-database" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="return-hash-values-for-all-collections-in-a-database"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example returns the hash value for all collections in the database <code class="leafygreen-ui-1l06pbn"> test </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use test\ndb.runCommand( { dbHash: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use test</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>( <!-- -->{ <span class="lg-highlight-attr">dbHash</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"host\" : \"myHostName.local:27017\",\n \"collections\" : {\n \"foo\" : \"d27b769230edc551d869060ec3fb68bd\",\n \"inventory\" : \"ec3d821581ea1bd3aa8196c94b946874\",\n \"log\" : \"d41d8cd98f00b204e9800998ecf8427e\",\n \"orders\" : \"0242c0a128c284ea9576a34db2306c12\",\n \"restaurants\" : \"5dc9b88091c36f0d529567b5b6e3fc92\",\n \"zipcodes\" : \"31ede812bf397509a87359c65bf2a08c\"\n },\n \"capped\" : [\n \"log\"\n ],\n \"uuids\" : {\n \"foo\" : UUID(\"469592fe-3bfe-425e-975f-cedbe0c4741d\"),\n \"inventory\" : UUID(\"0830e0ad-cc24-4fc7-80d0-8e22fe45e382\"),\n \"log\" : UUID(\"4be024ff-711b-4ab8-836b-dee662e090f1\"),\n \"orders\" : UUID(\"755be489-745f-400c-ac3b-f27525ad0108\"),\n \"restaurants\" : UUID(\"520b56ec-3276-4904-b6e5-286bc9bfa648\"),\n \"zipcodes\" : UUID(\"12e97b70-c174-40af-a178-5d83a241fe20\")\n },\n \"md5\" : \"0cb7417ae9d9eb865000b4debdc671da\",\n \"timeMillis\" : 53,\n \"ok\" : 1,\n \"operationTime\" : Timestamp(1529208582, 4),\n \"$clusterTime\" : {\n \"clusterTime\" : Timestamp(1529208582, 4),\n \"signature\" : {\n \"hash\" : BinData(0,\"X3MmevDqUgCVvN1AhnT+fiOL/Lc=\"),\n \"keyId\" : NumberLong(\"6567898567824900097\")\n }\n }\n}","programmingLanguage":"JSON"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"host"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"myHostName.local:27017"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"collections"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"foo"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"d27b769230edc551d869060ec3fb68bd"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"inventory"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"ec3d821581ea1bd3aa8196c94b946874"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"log"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"d41d8cd98f00b204e9800998ecf8427e"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"orders"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"0242c0a128c284ea9576a34db2306c12"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"restaurants"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"5dc9b88091c36f0d529567b5b6e3fc92"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"zipcodes"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"31ede812bf397509a87359c65bf2a08c"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"capped"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"log"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">]</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"uuids"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"foo"</span> <span class="lg-highlight-punctuation">:</span> UUID(<span class="lg-highlight-string">"469592fe-3bfe-425e-975f-cedbe0c4741d"</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"inventory"</span> <span class="lg-highlight-punctuation">:</span> UUID(<span class="lg-highlight-string">"0830e0ad-cc24-4fc7-80d0-8e22fe45e382"</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"log"</span> <span class="lg-highlight-punctuation">:</span> UUID(<span class="lg-highlight-string">"4be024ff-711b-4ab8-836b-dee662e090f1"</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"orders"</span> <span class="lg-highlight-punctuation">:</span> UUID(<span class="lg-highlight-string">"755be489-745f-400c-ac3b-f27525ad0108"</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"restaurants"</span> <span class="lg-highlight-punctuation">:</span> UUID(<span class="lg-highlight-string">"520b56ec-3276-4904-b6e5-286bc9bfa648"</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"zipcodes"</span> <span class="lg-highlight-punctuation">:</span> UUID(<span class="lg-highlight-string">"12e97b70-c174-40af-a178-5d83a241fe20"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"md5"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"0cb7417ae9d9eb865000b4debdc671da"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"timeMillis"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">53</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"ok"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">1</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"operationTime"</span> <span class="lg-highlight-punctuation">:</span> Timestamp(<span class="lg-highlight-number">1529208582</span><span class="lg-highlight-punctuation">,</span> <span class="lg-highlight-number">4</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"$clusterTime"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"clusterTime"</span> <span class="lg-highlight-punctuation">:</span> Timestamp(<span class="lg-highlight-number">1529208582</span><span class="lg-highlight-punctuation">,</span> <span class="lg-highlight-number">4</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"signature"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"hash"</span> <span class="lg-highlight-punctuation">:</span> BinData(<span class="lg-highlight-number">0</span><span class="lg-highlight-punctuation">,</span><span class="lg-highlight-string">"X3MmevDqUgCVvN1AhnT+fiOL/Lc="</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"keyId"</span> <span class="lg-highlight-punctuation">:</span> NumberLong(<span class="lg-highlight-string">"6567898567824900097"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Return Hash Values for Specified Collections in a Database <a class="headerlink leafygreen-ui-1kepx47" href="#return-hash-values-for-specified-collections-in-a-database" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="return-hash-values-for-specified-collections-in-a-database"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example returns the hash value for the collections <code class="leafygreen-ui-1l06pbn"> inventory </code> and <code class="leafygreen-ui-1l06pbn"> orders </code> in the database <code class="leafygreen-ui-1l06pbn"> test </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use test\ndb.runCommand( { dbHash: 1, collections: [ \"inventory\", \"orders\" ] } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use test</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>( <!-- -->{ <span class="lg-highlight-attr">dbHash</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">collections</span>: <!-- -->[ <span class="lg-highlight-string">"inventory"</span>, <span class="lg-highlight-string">"orders"</span> ] } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"host\" : \"myHostName.local:27017\",\n \"collections\" : {\n \"inventory\" : \"ec3d821581ea1bd3aa8196c94b946874\",\n \"orders\" : \"0242c0a128c284ea9576a34db2306c12\"\n },\n \"capped\" : [ ],\n \"uuids\" : {\n \"inventory\" : UUID(\"0830e0ad-cc24-4fc7-80d0-8e22fe45e382\"),\n \"orders\" : UUID(\"755be489-745f-400c-ac3b-f27525ad0108\")\n },\n \"md5\" : \"cb4676f316ff2ff29c701a5edd18afe3\",\n \"timeMillis\" : 0,\n \"ok\" : 1,\n \"operationTime\" : Timestamp(1529208801, 1),\n \"$clusterTime\" : {\n \"clusterTime\" : Timestamp(1529208801, 1),\n \"signature\" : {\n \"hash\" : BinData(0,\"I4z4a4Mgs+tcx0MP5xIU8DYAMB0=\"),\n \"keyId\" : NumberLong(\"6567898567824900097\")\n }\n }\n}","programmingLanguage":"JSON"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"host"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"myHostName.local:27017"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"collections"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"inventory"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"ec3d821581ea1bd3aa8196c94b946874"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"orders"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"0242c0a128c284ea9576a34db2306c12"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"capped"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span> <span class="lg-highlight-punctuation">]</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"uuids"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"inventory"</span> <span class="lg-highlight-punctuation">:</span> UUID(<span class="lg-highlight-string">"0830e0ad-cc24-4fc7-80d0-8e22fe45e382"</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"orders"</span> <span class="lg-highlight-punctuation">:</span> UUID(<span class="lg-highlight-string">"755be489-745f-400c-ac3b-f27525ad0108"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"md5"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"cb4676f316ff2ff29c701a5edd18afe3"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"timeMillis"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">0</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"ok"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">1</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"operationTime"</span> <span class="lg-highlight-punctuation">:</span> Timestamp(<span class="lg-highlight-number">1529208801</span><span class="lg-highlight-punctuation">,</span> <span class="lg-highlight-number">1</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"$clusterTime"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"clusterTime"</span> <span class="lg-highlight-punctuation">:</span> Timestamp(<span class="lg-highlight-number">1529208801</span><span class="lg-highlight-punctuation">,</span> <span class="lg-highlight-number">1</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"signature"</span> <span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"hash"</span> <span class="lg-highlight-punctuation">:</span> BinData(<span class="lg-highlight-number">0</span><span class="lg-highlight-punctuation">,</span><span class="lg-highlight-string">"I4z4a4Mgs+tcx0MP5xIU8DYAMB0="</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"keyId"</span> <span class="lg-highlight-punctuation">:</span> NumberLong(<span class="lg-highlight-string">"6567898567824900097"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/faq/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Frequently Asked Questions <a class="headerlink leafygreen-ui-1kepx47" href="#frequently-asked-questions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="frequently-asked-questions"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> FAQ pages in this section: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/faq/fundamentals/"> FAQ: MongoDB Fundamentals </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/faq/indexes/"> FAQ: Indexes </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/faq/concurrency/"> FAQ: Concurrency </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/faq/sharding/"> FAQ: Sharding with MongoDB </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/faq/replica-sets/"> FAQ: Replication and Replica Sets </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/faq/storage/"> FAQ: MongoDB Storage for Self-Managed Deployments </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/faq/diagnostics/"> FAQ: Self-Managed MongoDB Diagnostics </a> </p> </li> </ul> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/meta/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $meta <a class="headerlink leafygreen-ui-1kepx47" href="#-meta" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-meta"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $meta </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-meta" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-expression-exp.-meta"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns the metadata associated with a document, e.g. <code class="leafygreen-ui-1l06pbn"> "textScore" </code> when performing text search. </p> <p class="leafygreen-ui-1kp3ins"> A <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-meta" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $meta </code> </span> </a> expression has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $meta: &lt;metadatakeyword&gt; }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$meta</span>: &lt;<!-- -->metaDataKeyword<!-- -->&gt; <!-- -->}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-meta" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $meta </code> </span> </a> expression can specify the following values as the <code class="leafygreen-ui-1l06pbn"> &lt;metaDataKeyword&gt; </code> : </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Keyword </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> "textScore" </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Returns the score associated with the corresponding <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/text/#mongodb-query-op.-text"> <code class="leafygreen-ui-1l06pbn"> $text </code> </a> query for each matching document. The text score signifies how well the document matched the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/text/#std-label-match-operation-stemmed-words"> search term or terms <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> must be used in conjunction with a <code class="leafygreen-ui-1l06pbn"> $text </code> query. </p> <p class="leafygreen-ui-1kp3ins"> In earlier versions, if not used in conjunction with a <code class="leafygreen-ui-1l06pbn"> $text </code> query, returns a score of <!-- --> null <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $text </code> provides text query capabilities for self-managed (non-Atlas) deployments. For data hosted on MongoDB Atlas, MongoDB offers an improved full-text query solution, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/" target="_self"> <span> Atlas Search <!-- --> . </span> </a> </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> "indexKey" </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns an index key for the document if a non- <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-type-text"> text </a> index is used. The <code class="leafygreen-ui-1l06pbn"> { $meta: "indexKey" } </code> expression is for debugging purposes only, and not for application logic, and is preferred over <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.returnKey/#mongodb-method-cursor.returnKey"> <code class="leafygreen-ui-1l06pbn"> cursor.returnKey() </code> . </a> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/full-text-search/" target="_self"> <span> MongoDB Atlas Search </span> </a> provides additional <code class="leafygreen-ui-1l06pbn"> $meta </code> keywords, such as: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/scoring/" target="_self"> <span> "searchScore" </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/highlighting/" target="_self"> <span> "searchHighlights" </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/paginate-results/" target="_self"> <span> "searchSequenceToken" </span> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Refer to the Atlas Search documentation for details. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The following <code class="leafygreen-ui-1l06pbn"> $meta </code> keywords are not supported in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/stable-api/#std-label-stable-api"> Stable API </a> V1: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "textScore" </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "indexKey" </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "searchScore" </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "searchHighlights" </code> </p> </li> </ul> </div> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <span class="leafygreen-ui-1qnjd6d" id="std-label-project-meta-textscore-sort"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Text Score Metadata <code class="leafygreen-ui-1l06pbn"> $meta: "textScore" </code> <a class="headerlink leafygreen-ui-1kepx47" href="#text-score-metadata--meta---textscore-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="text-score-metadata--meta---textscore-"> </div> </a> </h3> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Requires $text Search <a class="headerlink leafygreen-ui-1kepx47" href="#requires--text-search" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="requires--text-search"> </div> </a> </h4> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> expression must be used in conjunction with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/text/#mongodb-query-op.-text"> <code class="leafygreen-ui-1l06pbn"> $text </code> </a> . For example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In aggregation, you must specify a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/match/#mongodb-pipeline-pipe.-match"> <code class="leafygreen-ui-1l06pbn"> $match </code> </a> stage with a <code class="leafygreen-ui-1l06pbn"> $text </code> query in the pipeline to use the <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> expression in later stage(s). If you do not specify the <code class="leafygreen-ui-1l06pbn"> $text </code> query in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/match/#mongodb-pipeline-pipe.-match"> <code class="leafygreen-ui-1l06pbn"> $match </code> </a> stage, the operation fails. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In find, you must specify the <code class="leafygreen-ui-1l06pbn"> $text </code> operator in the query predicate to use <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> . If you do not specify the <code class="leafygreen-ui-1l06pbn"> $text </code> operator in the query predicate, the operation fails. </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $text </code> provides text query capabilities for self-managed (non-Atlas) deployments. For data hosted on MongoDB Atlas, MongoDB offers an improved full-text query solution, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/" target="_self"> <span> Atlas Search <!-- --> . </span> </a> </p> </div> </div> </li> </ul> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Availability <a class="headerlink leafygreen-ui-1kepx47" href="#availability" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="availability"> </div> </a> </h4> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In aggregation, the <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> expression can be included in various stages that accept aggregation expressions, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/project/#mongodb-pipeline-pipe.-project"> <code class="leafygreen-ui-1l06pbn"> $project </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sort/#mongodb-pipeline-pipe.-sort"> <code class="leafygreen-ui-1l06pbn"> $sort </code> </a> , etc. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In find, the <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> expression can be included in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#std-label-find-projection"> projection </a> and in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.sort/#mongodb-method-cursor.sort"> <code class="leafygreen-ui-1l06pbn"> sort() </code> . </a> </p> </li> </ul> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Usage In Projection <a class="headerlink leafygreen-ui-1kepx47" href="#usage-in-projection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="usage-in-projection"> </div> </a> </h4> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> expression can be a part of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-projection"> projection </a> document to include the text score metadata. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-meta" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $meta </code> </span> </a> expression can be present in either an inclusion or an exclusion projection. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you set the expression to a field name that already exists in the document, the projected metadata value overwrites the existing value. </p> </li> </ul> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Filter on Text Score <a class="headerlink leafygreen-ui-1kepx47" href="#filter-on-text-score" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="filter-on-text-score"> </div> </a> </h4> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In aggregation, following a stage that outputs a field with the text score value, you can specify a query condition or operate on the field in subsequent stages. For example, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/text-search-in-aggregation/"> $text in the Aggregation Pipeline on Self-Managed Deployments <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In find, you cannot specify a query condition on the text score. Use aggregation instead. </p> </li> </ul> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Usage In Sort <a class="headerlink leafygreen-ui-1kepx47" href="#usage-in-sort" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="usage-in-sort"> </div> </a> </h4> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> expression can be used as a part of a sort operation to sort by the text score metadata; i.e., </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In aggregation, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sort/#mongodb-pipeline-pipe.-sort"> <code class="leafygreen-ui-1l06pbn"> $sort </code> </a> stage. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In find, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.sort/#mongodb-method-cursor.sort"> <code class="leafygreen-ui-1l06pbn"> sort() </code> </a> method. </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> "textScore" </code> metadata sorts in descending order. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To use in a sort operation, set the <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> expression to an arbitrary field name. The field name is disregarded by the query system. </p> </li> </ul> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Sort without Projection <a class="headerlink leafygreen-ui-1kepx47" href="#sort-without-projection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sort-without-projection"> </div> </a> </h4> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In aggregation, you can sort the resulting documents by <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> without also having to project the <code class="leafygreen-ui-1l06pbn"> textScore </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In find, you can sort the resulting documents by <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> without also having to project the <code class="leafygreen-ui-1l06pbn"> textScore </code> . </p> </li> </ul> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Sort with Projection <a class="headerlink leafygreen-ui-1kepx47" href="#sort-with-projection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sort-with-projection"> </div> </a> </h4> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In aggregation, if you include the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-meta" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> </span> </a> expression in both the projection and sort, the projection and sort can have different field names for the expression. The field name in the sort is disregarded by the query system. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In find, if you include the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-meta" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> </span> </a> expression in both the projection and sort, the projection and sort can have different field names for the expression. The field name in the sort is disregarded by the query system. </p> </li> </ul> </section> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Index Key Metadata $meta: "indexKey" (Aggregation and Find) <a class="headerlink leafygreen-ui-1kepx47" href="#index-key-metadata--meta---indexkey---aggregation-and-find-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="index-key-metadata--meta---indexkey---aggregation-and-find-"> </div> </a> </h3> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Usage <a class="headerlink leafygreen-ui-1kepx47" href="#usage" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="usage"> </div> </a> </h4> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> { $meta: "indexKey" } </code> expression is for debugging purposes only and not for application logic. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> { $meta: "indexKey" } </code> expression is preferred over <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.returnKey/#mongodb-method-cursor.returnKey"> <code class="leafygreen-ui-1l06pbn"> cursor.returnKey() </code> . </a> </p> </li> </ul> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Availability <a class="headerlink leafygreen-ui-1kepx47" href="#availability-1" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="availability-1"> </div> </a> </h4> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> In aggregation </strong> , the <code class="leafygreen-ui-1l06pbn"> { $meta: "indexKey" } </code> expression can be included in various stages that accept aggregation expressions, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/project/#mongodb-pipeline-pipe.-project"> <code class="leafygreen-ui-1l06pbn"> $project </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sortByCount/#mongodb-pipeline-pipe.-sortByCount"> <code class="leafygreen-ui-1l06pbn"> $sortByCount </code> </a> , etc., but not <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sort/#mongodb-pipeline-pipe.-sort"> <code class="leafygreen-ui-1l06pbn"> $sort </code> </a> . However, with an aggregation pipeline, you can first project the <code class="leafygreen-ui-1l06pbn"> { $meta: "indexKey" } </code> expression (such as in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/project/#mongodb-pipeline-pipe.-project"> <code class="leafygreen-ui-1l06pbn"> $project </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/addFields/#mongodb-pipeline-pipe.-addFields"> <code class="leafygreen-ui-1l06pbn"> $addFields </code> </a> , etc. ) and then, sort by that field in a subsequent <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sort/#mongodb-pipeline-pipe.-sort"> <code class="leafygreen-ui-1l06pbn"> $sort </code> </a> stage. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> In find </strong> , the <code class="leafygreen-ui-1l06pbn"> { $meta: "indexKey" } </code> expression is only available as part of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-projection"> projection </a> document. </p> </li> </ul> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Return Value <a class="headerlink leafygreen-ui-1kepx47" href="#return-value" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="return-value"> </div> </a> </h4> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The value returned depends on how the database decides to represent values in an index and may change across versions. The represented value may not be the actual value for the field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The value returned depends on the execution plan chosen by the system. For example, if there are two possible indexes which can be used to answer the query, then the value of the "indexKey" metadata depends on which index is selected. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If an index is <strong class="css-4dei7l"> not </strong> used, the <code class="leafygreen-ui-1l06pbn"> { $meta: "indexKey" } </code> expression does not return a value and the field is not included as part of the output. </p> </li> </ul> </section> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> $meta: "textScore" </code> <a class="headerlink leafygreen-ui-1kepx47" href="#-meta---textscore-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-meta---textscore-"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Create an <code class="leafygreen-ui-1l06pbn"> articles </code> collection with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.articles.insertMany([\n { \"_id\" : 1, \"title\" : \"cakes and ale\" },\n { \"_id\" : 2, \"title\" : \"more cakes\" },\n { \"_id\" : 3, \"title\" : \"bread\" },\n { \"_id\" : 4, \"title\" : \"some cakes\" },\n { \"_id\" : 5, \"title\" : \"two cakes to go\" },\n { \"_id\" : 6, \"title\" : \"pie\" }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">articles</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"title"</span> <!-- -->: <span class="lg-highlight-string">"cakes and ale"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"title"</span> <!-- -->: <span class="lg-highlight-string">"more cakes"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"title"</span> <!-- -->: <span class="lg-highlight-string">"bread"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"title"</span> <!-- -->: <span class="lg-highlight-string">"some cakes"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"title"</span> <!-- -->: <span class="lg-highlight-string">"two cakes to go"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-string">"title"</span> <!-- -->: <span class="lg-highlight-string">"pie"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Create a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/create-text-index/#std-label-create-text-index"> text index </a> on the <code class="leafygreen-ui-1l06pbn"> title </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.articles.createIndex( { title: \"text\"} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">articles</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">title</span>: <span class="lg-highlight-string">"text"</span>} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-21"> <div aria-label="Tabs to describe usage of aggregation/find" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_syuk8gymr" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_7ngtnochb" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Aggregation </div> </button> <button aria-controls="_ytoecdir7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_t59onbmp8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Find and Project </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_n1cdfii9v" class="" id="_ahe2s7gdr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following aggregation operation performs a text search and uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-meta" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $meta </code> </span> </a> operator to group by the text search score: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.articles.aggregate(\n [\n { $match: { $text: { $search: \"cake\" } } },\n { $group: { _id: { $meta: \"textScore\" }, count: { $sum: 1 } } }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">articles</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$match</span>: <!-- -->{ <span class="lg-highlight-attr">$text</span>: <!-- -->{ <span class="lg-highlight-attr">$search</span>: <span class="lg-highlight-string">"cake"</span> } } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$group</span>: <!-- -->{ <span class="lg-highlight-attr">_id</span>: <!-- -->{ <span class="lg-highlight-attr">$meta</span>: <span class="lg-highlight-string">"textScore"</span> }<!-- -->, <span class="lg-highlight-attr">count</span>: <!-- -->{ <span class="lg-highlight-attr">$sum</span>: <span class="lg-highlight-number">1</span> } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 0.75, \"count\" : 1 }\n{ \"_id\" : 0.6666666666666666, \"count\" : 1 }\n{ \"_id\" : 1, \"count\" : 2 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0.75</span>, <span class="lg-highlight-string">"count"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0.6666666666666666</span>, <span class="lg-highlight-string">"count"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"count"</span> <!-- -->: <span class="lg-highlight-number">2</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more examples, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/text-search-in-aggregation/"> $text in the Aggregation Pipeline on Self-Managed Deployments <!-- --> . </a> </p> </div> </div> </div> <div> <div aria-labelledby="_7akg8y09c" class="leafygreen-ui-38lglc" id="_xpo754cv8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following query performs a text search for the term <code class="leafygreen-ui-1l06pbn"> cake </code> and uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-meta" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $meta </code> </span> </a> operator in the projection document to include the score assigned to each matching document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.articles.find(\n { $text: { $search: \"cake\" } },\n { score: { $meta: \"textScore\" } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">articles</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$text</span>: <!-- -->{ <span class="lg-highlight-attr">$search</span>: <span class="lg-highlight-string">"cake"</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">score</span>: <!-- -->{ <span class="lg-highlight-attr">$meta</span>: <span class="lg-highlight-string">"textScore"</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following documents with the text score: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 4, \"title\" : \"some cakes\", \"score\" : 1 }\n{ \"_id\" : 1, \"title\" : \"cakes and ale\", \"score\" : 0.75 }\n{ \"_id\" : 5, \"title\" : \"two cakes to go\", \"score\" : 0.6666666666666666 }\n{ \"_id\" : 2, \"title\" : \"more cakes\", \"score\" : 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"title"</span> <!-- -->: <span class="lg-highlight-string">"some cakes"</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"title"</span> <!-- -->: <span class="lg-highlight-string">"cakes and ale"</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">0.75</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"title"</span> <!-- -->: <span class="lg-highlight-string">"two cakes to go"</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">0.6666666666666666</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"title"</span> <!-- -->: <span class="lg-highlight-string">"more cakes"</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For additional examples of <code class="leafygreen-ui-1l06pbn"> "textScore" </code> projections and sorts, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/text/#std-label-ex-text-search-score"> Relevance Score Examples <!-- --> . </a> </p> </div> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> $meta: "indexKey" </code> <a class="headerlink leafygreen-ui-1kepx47" href="#-meta---indexkey-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-meta---indexkey-"> </div> </a> </h3> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> { $meta: "indexKey" } </code> expression is for debugging purposes only and not for application logic. MongoDB returns the value associated with the index chosen by the query system. The system can choose a different index upon subsequent execution. </p> <p class="leafygreen-ui-1kp3ins"> For the selected index, the value returned depends on how the database decides to represent values in an index and may change across versions. The represented value may not be the actual value for the field. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Create an <code class="leafygreen-ui-1l06pbn"> orders </code> collection with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.orders.insertMany([\n { \"item\" : \"abc\", \"price\" : NumberDecimal(\"12\"), \"quantity\" : 2, \"type\": \"apparel\" },\n { \"item\" : \"jkl\", \"price\" : NumberDecimal(\"20\"), \"quantity\" : 1, \"type\": \"electronics\" },\n { \"item\" : \"abc\", \"price\" : NumberDecimal(\"10\"), \"quantity\" : 5, \"type\": \"apparel\" }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">orders</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>(<span class="lg-highlight-string">"12"</span>)<!-- -->, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span>: <span class="lg-highlight-string">"apparel"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"jkl"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>(<span class="lg-highlight-string">"20"</span>)<!-- -->, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span>: <span class="lg-highlight-string">"electronics"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>(<span class="lg-highlight-string">"10"</span>)<!-- -->, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span>: <span class="lg-highlight-string">"apparel"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Create the following compound index on the <code class="leafygreen-ui-1l06pbn"> type </code> and <code class="leafygreen-ui-1l06pbn"> item </code> fields: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.orders.createIndex( { type: 1, item: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">orders</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-23"> <div aria-label="Tabs to describe usage of aggregation/find" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_ziqk168vq" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_95jfh4oj4" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Aggregation </div> </button> <button aria-controls="_a2p4ro75l" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_10m6nlk5b" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Find and Project </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_394clvmt8" class="" id="_p0imwlxuc" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following aggregation operation finds all documents with <code class="leafygreen-ui-1l06pbn"> type </code> equal to <code class="leafygreen-ui-1l06pbn"> apparel </code> and uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-meta" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $meta </code> </span> </a> operator to include the index key value for the matching document if an index was used: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.orders.aggregate(\n [\n { $match: { type: \"apparel\" } },\n { $addFields: { idxKey: { $meta: \"indexKey\" } } }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">orders</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$match</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"apparel"</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$addFields</span>: <!-- -->{ <span class="lg-highlight-attr">idxKey</span>: <!-- -->{ <span class="lg-highlight-attr">$meta</span>: <span class="lg-highlight-string">"indexKey"</span> } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_pvo5d6htm" class="leafygreen-ui-38lglc" id="_tmnwunzt3" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following operation finds all documents with <code class="leafygreen-ui-1l06pbn"> type </code> equal to <code class="leafygreen-ui-1l06pbn"> apparel </code> and uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-meta" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $meta </code> </span> </a> operator to include the index key value for the matching document if an index was used: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.orders.find( { type: \"apparel\" }, { idxKey: { $meta: \"indexKey\" } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">orders</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"apparel"</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">idxKey</span>: <!-- -->{ <span class="lg-highlight-attr">$meta</span>: <span class="lg-highlight-string">"indexKey"</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the matching documents with their corresponding index key: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : ObjectId(\"5e98a33ceaf5e9dcf2b8dcde\"),\n \"item\" : \"abc\",\n \"price\" : NumberDecimal(\"12\"),\n \"quantity\" : 2,\n \"type\" : \"apparel\",\n \"idxKey\" : { \"type\" : \"apparel\", \"item\" : \"abc\" }\n}\n{\n \"_id\" : ObjectId(\"5e98a33ceaf5e9dcf2b8dce0\"),\n \"item\" : \"abc\",\n \"price\" : NumberDecimal(\"10\"),\n \"quantity\" : 5,\n \"type\" : \"apparel\",\n \"idxKey\" : { \"type\" : \"apparel\", \"item\" : \"abc\" }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"5e98a33ceaf5e9dcf2b8dcde"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>(<span class="lg-highlight-string">"12"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"apparel"</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"idxKey"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"apparel"</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"5e98a33ceaf5e9dcf2b8dce0"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>(<span class="lg-highlight-string">"10"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">5</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"apparel"</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"idxKey"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"apparel"</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If <strong class="css-4dei7l"> no </strong> index is used, the <code class="leafygreen-ui-1l06pbn"> { $meta: "indexKey" } </code> does not return anything. </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-24"> <div aria-label="Tabs to describe usage of aggregation/find" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_agtfb7xy0" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_d3q1kw5qo" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Aggregation </div> </button> <button aria-controls="_glugc1r60" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ds1wa3kdo" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Find and Project </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_rlwjptp75" class="" id="_qvcqpmc5r" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> For example, the following operation does not use an index since no index exists on the <code class="leafygreen-ui-1l06pbn"> price </code> field to support the match condition: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.orders.aggregate(\n [\n { $match: { price: { $gte: NumberDecimal(\"10\") } } },\n { $addFields: { idxKey: { $meta: \"indexKey\" } } }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">orders</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$match</span>: <!-- -->{ <span class="lg-highlight-attr">price</span>: <!-- -->{ <span class="lg-highlight-attr">$gte</span>: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>(<span class="lg-highlight-string">"10"</span>) } } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$addFields</span>: <!-- -->{ <span class="lg-highlight-attr">idxKey</span>: <!-- -->{ <span class="lg-highlight-attr">$meta</span>: <span class="lg-highlight-string">"indexKey"</span> } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_10mhfstz7" class="leafygreen-ui-38lglc" id="_vdrptgbnd" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> For example, the following operation does not use an index since no index exists on the <code class="leafygreen-ui-1l06pbn"> price </code> field to support the match condition: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.orders.find(\n { price: { $gte: NumberDecimal(\"10\") } },\n { idxKey: { $meta: \"indexKey\" } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">orders</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">price</span>: <!-- -->{ <span class="lg-highlight-attr">$gte</span>: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>(<span class="lg-highlight-string">"10"</span>) } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">idxKey</span>: <!-- -->{ <span class="lg-highlight-attr">$meta</span>: <span class="lg-highlight-string">"indexKey"</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the matching documents without the <code class="leafygreen-ui-1l06pbn"> idxKey </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : ObjectId(\"5e98a33ceaf5e9dcf2b8dcde\"),\n \"item\" : \"abc\",\n \"price\" : NumberDecimal(\"12\"),\n \"quantity\" : 2,\n \"type\" : \"apparel\"\n}\n{\n \"_id\" : ObjectId(\"5e98a33ceaf5e9dcf2b8dcdf\"),\n \"item\" : \"jkl\",\n \"price\" : NumberDecimal(\"20\"),\n \"quantity\" : 1,\n \"type\" : \"electronics\"\n}\n{\n \"_id\" : ObjectId(\"5e98a33ceaf5e9dcf2b8dce0\"),\n \"item\" : \"abc\",\n \"price\" : NumberDecimal(\"10\"),\n \"quantity\" : 5,\n \"type\" : \"apparel\"\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"5e98a33ceaf5e9dcf2b8dcde"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>(<span class="lg-highlight-string">"12"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"apparel"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"5e98a33ceaf5e9dcf2b8dcdf"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"jkl"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>(<span class="lg-highlight-string">"20"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"electronics"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"5e98a33ceaf5e9dcf2b8dce0"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"abc"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>(<span class="lg-highlight-string">"10"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">5</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"apparel"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/covarianceSamp/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $covarianceSamp (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-covariancesamp--aggregation-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-covariancesamp--aggregation-"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <div> <p> <em> New <!-- --> in version <!-- --> 5.0 </em> . </p> </div> <dl class="group"> <dt> <code class="leafygreen-ui-1l06pbn"> $covarianceSamp </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-group-grp.-covarianceSamp" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-group-grp.-covarianceSamp"> </div> </a> </dt> <dd> </dd> </dl> <p class="leafygreen-ui-1kp3ins"> Returns the sample covariance of two numeric <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expressions </a> that are evaluated using documents in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-window"> window <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-covarianceSamp" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $covarianceSamp </code> </span> </a> is only available in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-covarianceSamp" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $covarianceSamp </code> </span> </a> syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n $covarianceSamp:\n [\n &lt;numeric&gt;,\n &lt;numeric&gt;\n ]\n}"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> $covarianceSamp:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;numeric expression 1&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;numeric expression 2&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-covarianceSamp" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $covarianceSamp </code> </span> </a> behavior: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Ignores non-numeric values, <code class="leafygreen-ui-1l06pbn"> null </code> values, and missing fields in a window. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the window contains one document, returns <code class="leafygreen-ui-1l06pbn"> null </code> . (Compare to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/covariancePop/#mongodb-group-grp.-covariancePop"> <code class="leafygreen-ui-1l06pbn"> $covariancePop </code> </a> , which returns <code class="leafygreen-ui-1l06pbn"> 0 </code> if the window contains one document.) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the window is empty, returns <code class="leafygreen-ui-1l06pbn"> null </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the window contains a <code class="leafygreen-ui-1l06pbn"> NaN </code> value, returns <code class="leafygreen-ui-1l06pbn"> NaN </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the window contains one or more <code class="leafygreen-ui-1l06pbn"> Infinity </code> value(s) that are all positive or all negative, returns <code class="leafygreen-ui-1l06pbn"> Infinity </code> . The returned <code class="leafygreen-ui-1l06pbn"> Infinity </code> value has the same sign as the <code class="leafygreen-ui-1l06pbn"> Infinity </code> values in the window. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the window contains <code class="leafygreen-ui-1l06pbn"> Infinity </code> values with different signs, returns <code class="leafygreen-ui-1l06pbn"> NaN </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the window contains a <code class="leafygreen-ui-1l06pbn"> decimal </code> value, returns a <code class="leafygreen-ui-1l06pbn"> decimal </code> value. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If none of the previous points apply, returns a <code class="leafygreen-ui-1l06pbn"> double </code> value. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The returned values in order of precedence are as follows: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> NaN </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> Infinity </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> decimal </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> double </code> </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Create a <code class="leafygreen-ui-1l06pbn"> cakeSales </code> collection that contains cake sales in the states of California ( <code class="leafygreen-ui-1l06pbn"> CA </code> ) and Washington ( <code class="leafygreen-ui-1l06pbn"> WA </code> ): </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.insertMany( [\n { _id: 0, type: \"chocolate\", orderDate: new Date(\"2020-05-18T14:10:30Z\"),\n state: \"CA\", price: 13, quantity: 120 },\n { _id: 1, type: \"chocolate\", orderDate: new Date(\"2021-03-20T11:30:05Z\"),\n state: \"WA\", price: 14, quantity: 140 },\n { _id: 2, type: \"vanilla\", orderDate: new Date(\"2021-01-11T06:31:15Z\"),\n state: \"CA\", price: 12, quantity: 145 },\n { _id: 3, type: \"vanilla\", orderDate: new Date(\"2020-02-08T13:13:23Z\"),\n state: \"WA\", price: 13, quantity: 104 },\n { _id: 4, type: \"strawberry\", orderDate: new Date(\"2019-05-18T16:09:01Z\"),\n state: \"CA\", price: 41, quantity: 162 },\n { _id: 5, type: \"strawberry\", orderDate: new Date(\"2019-01-08T06:12:03Z\"),\n state: \"WA\", price: 43, quantity: 134 }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">120</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">140</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">145</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">104</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">162</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">134</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This example uses <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-covarianceSamp" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $covarianceSamp </code> </span> </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> stage to output the sample covariance values for the cake sales <code class="leafygreen-ui-1l06pbn"> orderDate </code> year and <code class="leafygreen-ui-1l06pbn"> quantity </code> values: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.aggregate( [\n {\n $setWindowFields: {\n partitionBy: \"$state\",\n sortBy: { orderDate: 1 },\n output: {\n covarianceSampForState: {\n $covarianceSamp: [ { $year: \"$orderDate\" }, \"$quantity\" ],\n window: {\n documents: [ \"unbounded\", \"current\" ]\n }\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <span class="lg-highlight-string">"$state"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">covarianceSampForState</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$covarianceSamp</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">$year</span>: <span class="lg-highlight-string">"$orderDate"</span> }<!-- -->, <span class="lg-highlight-string">"$quantity"</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">window</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">documents</span>: <!-- -->[ <span class="lg-highlight-string">"unbounded"</span>, <span class="lg-highlight-string">"current"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> partitionBy: "$state" </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-partitionBy"> partitions </a> the documents in the collection by <code class="leafygreen-ui-1l06pbn"> state </code> . There are partitions for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sortBy: { orderDate: 1 } </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-sortBy"> sorts </a> the documents in each partition by <code class="leafygreen-ui-1l06pbn"> orderDate </code> in ascending order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ), so the earliest <code class="leafygreen-ui-1l06pbn"> orderDate </code> is first. </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> output </code> sets the sample covariance values for the <code class="leafygreen-ui-1l06pbn"> orderDate </code> year and <code class="leafygreen-ui-1l06pbn"> quantity </code> values using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-covarianceSamp" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $covarianceSamp </code> </span> </a> run in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-documents"> documents </a> window. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#std-label-setWindowFields-window"> window </a> contains documents between an <code class="leafygreen-ui-1l06pbn"> unbounded </code> lower limit and the <code class="leafygreen-ui-1l06pbn"> current </code> document in the output. This means <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-group-grp.-covarianceSamp" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $covarianceSamp </code> </span> </a> sets the <code class="leafygreen-ui-1l06pbn"> covarianceSampForState </code> field to the sample covariance values for the documents between the beginning of the partition and the current document. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> In this output, the sample covariance is shown in the <code class="leafygreen-ui-1l06pbn"> covarianceSampForState </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 4, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-05-18T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 41, \"quantity\" : 162, \"covarianceSampForState\" : null }\n{ \"_id\" : 0, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2020-05-18T14:10:30Z\"),\n \"state\" : \"CA\", \"price\" : 13, \"quantity\" : 120, \"covarianceSampForState\" : -21 }\n{ \"_id\" : 2, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2021-01-11T06:31:15Z\"),\n \"state\" : \"CA\", \"price\" : 12, \"quantity\" : 145, \"covarianceSampForState\" : -8.500000000000007 }\n{ \"_id\" : 5, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 43, \"quantity\" : 134, \"covarianceSampForState\" : null }\n{ \"_id\" : 3, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2020-02-08T13:13:23Z\"),\n \"state\" : \"WA\", \"price\" : 13, \"quantity\" : 104, \"covarianceSampForState\" : -15 }\n{ \"_id\" : 1, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2021-03-20T11:30:05Z\"),\n \"state\" : \"WA\", \"price\" : 14, \"quantity\" : 140, \"covarianceSampForState\" : 3 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>, <span class="lg-highlight-string">"covarianceSampForState"</span> <!-- -->: <span class="lg-highlight-literal">null</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">120</span>, <span class="lg-highlight-string">"covarianceSampForState"</span> <!-- -->: <!-- -->-<span class="lg-highlight-number">21</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">145</span>, <span class="lg-highlight-string">"covarianceSampForState"</span> <!-- -->: <!-- -->-<span class="lg-highlight-number">8.500000000000007</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"covarianceSampForState"</span> <!-- -->: <span class="lg-highlight-literal">null</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">104</span>, <span class="lg-highlight-string">"covarianceSampForState"</span> <!-- -->: <!-- -->-<span class="lg-highlight-number">15</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">140</span>, <span class="lg-highlight-string">"covarianceSampForState"</span> <!-- -->: <span class="lg-highlight-number">3</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/cursor.sort/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> cursor.sort() <a class="headerlink leafygreen-ui-1kepx47" href="#cursor.sort--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="cursor.sort--"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#return-in-natural-order" target="_self"> <span> Return in Natural Order </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> cursor.sort(sort) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-cursor.sort" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-cursor.sort"> </div> </a> </dt> <dd> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> mongosh Method </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page documents a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> method. This is <em> not </em> the documentation for a language-specific driver, such as Node.js. </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB API drivers, refer to the language-specific <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB driver documentation <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Specifies the order in which the query returns matching documents. You must apply <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-cursor.sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> sort() </code> </span> </a> to the cursor before retrieving any documents from the database. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can use <code class="leafygreen-ui-1l06pbn"> cursor.sort(sort) </code> for deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-cursor.sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> sort() </code> </span> </a> method has the following parameter: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> sort </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> A document that defines the sort order of the result set. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> sort </code> parameter contains field and value pairs, in the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ field: value }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">field</span>: <!-- -->value }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The sort document can specify <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-sort-asc-desc" target="_self"> <span> ascending or descending sort on existing fields </span> </a> or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-sort-metadata" target="_self"> <span> sort on text score metadata <!-- --> . </span> </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Limits <a class="headerlink leafygreen-ui-1kepx47" href="#limits" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="limits"> </div> </a> </h3> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can sort on a maximum of 32 keys. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Providing a sort pattern with duplicate fields causes an error. </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-sort-cursor-consistent-sorting"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sort Consistency <a class="headerlink leafygreen-ui-1kepx47" href="#sort-consistency" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sort-consistency"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB does not store documents in a collection in a particular order. When sorting on a field which contains duplicate values, documents containing those values may be returned in any order. </p> <p class="leafygreen-ui-1kp3ins"> If consistent sort order is desired, include at least one field in your sort that contains unique values. The easiest way to guarantee this is to include the <code class="leafygreen-ui-1l06pbn"> _id </code> field in your sort query. </p> <p class="leafygreen-ui-1kp3ins"> Consider the following <code class="leafygreen-ui-1l06pbn"> restaurant </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.restaurants.insertMany( [\n { \"_id\" : 1, \"name\" : \"Central Park Cafe\", \"borough\" : \"Manhattan\"},\n { \"_id\" : 2, \"name\" : \"Rock A Feller Bar and Grill\", \"borough\" : \"Queens\"},\n { \"_id\" : 3, \"name\" : \"Empire State Pub\", \"borough\" : \"Brooklyn\"},\n { \"_id\" : 4, \"name\" : \"Stan's Pizzaria\", \"borough\" : \"Manhattan\"},\n { \"_id\" : 5, \"name\" : \"Jane's Deli\", \"borough\" : \"Brooklyn\"},\n] );","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light js leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">restaurants</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Central Park Cafe"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Manhattan"</span>}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Rock A Feller Bar and Grill"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Queens"</span>}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Empire State Pub"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Brooklyn"</span>}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Stan's Pizzaria"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Manhattan"</span>}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Jane's Deli"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Brooklyn"</span>}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following command uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-cursor.sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> sort() </code> </span> </a> method to sort on the <code class="leafygreen-ui-1l06pbn"> borough </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.restaurants.find().sort( { \"borough\": 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light js leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">restaurants</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-string">"borough"</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In this example, sort order may be inconsistent, since the <code class="leafygreen-ui-1l06pbn"> borough </code> field contains duplicate values for both <code class="leafygreen-ui-1l06pbn"> Manhattan </code> and <code class="leafygreen-ui-1l06pbn"> Brooklyn </code> . Documents are returned in alphabetical order by <code class="leafygreen-ui-1l06pbn"> borough </code> , but the order of those documents with duplicate values for <code class="leafygreen-ui-1l06pbn"> borough </code> might not be the same across multiple executions of the same sort. For example, here are the results from two different executions of the above command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 3, \"name\" : \"Empire State Pub\", \"borough\" : \"Brooklyn\" }\n{ \"_id\" : 5, \"name\" : \"Jane's Deli\", \"borough\" : \"Brooklyn\" }\n{ \"_id\" : 1, \"name\" : \"Central Park Cafe\", \"borough\" : \"Manhattan\" }\n{ \"_id\" : 4, \"name\" : \"Stan's Pizzaria\", \"borough\" : \"Manhattan\" }\n{ \"_id\" : 2, \"name\" : \"Rock A Feller Bar and Grill\", \"borough\" : \"Queens\" }\n\n{ \"_id\" : 5, \"name\" : \"Jane's Deli\", \"borough\" : \"Brooklyn\" }\n{ \"_id\" : 3, \"name\" : \"Empire State Pub\", \"borough\" : \"Brooklyn\" }\n{ \"_id\" : 4, \"name\" : \"Stan's Pizzaria\", \"borough\" : \"Manhattan\" }\n{ \"_id\" : 1, \"name\" : \"Central Park Cafe\", \"borough\" : \"Manhattan\" }\n{ \"_id\" : 2, \"name\" : \"Rock A Feller Bar and Grill\", \"borough\" : \"Queens\" }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light js leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Empire State Pub"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Brooklyn"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Jane's Deli"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Brooklyn"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Central Park Cafe"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Manhattan"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Stan's Pizzaria"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Manhattan"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Rock A Feller Bar and Grill"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Queens"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Jane's Deli"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Brooklyn"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Empire State Pub"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Brooklyn"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Stan's Pizzaria"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Manhattan"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Central Park Cafe"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Manhattan"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Rock A Feller Bar and Grill"</span>, <span class="lg-highlight-string">"borough"</span> <!-- -->: <span class="lg-highlight-string">"Queens"</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> While the values for <code class="leafygreen-ui-1l06pbn"> borough </code> are still sorted in alphabetical order, the order of the documents containing duplicate values for <code class="leafygreen-ui-1l06pbn"> borough </code> (i.e. <code class="leafygreen-ui-1l06pbn"> Manhattan </code> and <code class="leafygreen-ui-1l06pbn"> Brooklyn </code> ) is not the same. </p> <p class="leafygreen-ui-1kp3ins"> To achieve a <em> consistent sort </em> , add a field which contains exclusively unique values to the sort. The following command uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-cursor.sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> sort() </code> </span> </a> method to sort on both the <code class="leafygreen-ui-1l06pbn"> borough </code> field and the <code class="leafygreen-ui-1l06pbn"> _id </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.restaurants.find().sort( { \"borough\": 1, \"_id\": 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light js leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">restaurants</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-string">"borough"</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"_id"</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Since the <code class="leafygreen-ui-1l06pbn"> _id </code> field is always guaranteed to contain exclusively unique values, the returned sort order will always be the same across multiple executions of the same sort. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-sort-asc-desc"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Ascending/Descending Sort <a class="headerlink leafygreen-ui-1kepx47" href="#ascending-descending-sort" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="ascending-descending-sort"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Specify in the sort parameter the field or fields to sort by and a value of <code class="leafygreen-ui-1l06pbn"> 1 </code> or <code class="leafygreen-ui-1l06pbn"> -1 </code> to specify an ascending or descending sort respectively. </p> <p class="leafygreen-ui-1kp3ins"> The following operation sorts the documents first by the <code class="leafygreen-ui-1l06pbn"> age </code> field in descending order and then by the <code class="leafygreen-ui-1l06pbn"> posts </code> field in ascending order: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.users.find({ }).sort( { age : -1, posts: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">users</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->{ <!-- -->}).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <!-- -->age <!-- -->: <!-- -->-<span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">posts</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> When comparing values of different <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-bson-types"> BSON types </a> in sort operations, MongoDB uses the following comparison order, from lowest to highest: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MinKey (internal type) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Null </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Numbers (ints, longs, doubles, decimals) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Symbol, String </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Object </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Array </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> BinData </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> ObjectId </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Boolean </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Date </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Timestamp </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Regular Expression </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MaxKey (internal type) </p> </li> </ol> <p class="leafygreen-ui-1kp3ins"> For details on the comparison/sort order for specific types, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-type-comparison-order/#std-label-bson-types-comparison-order"> Comparison/Sort Order <!-- --> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-sort-metadata"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Text Score Metadata Sort <a class="headerlink leafygreen-ui-1kepx47" href="#text-score-metadata-sort" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="text-score-metadata-sort"> </div> </a> </h3> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $text </code> provides text query capabilities for self-managed (non-Atlas) deployments. For data hosted on MongoDB Atlas, MongoDB offers an improved full-text query solution, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/" target="_self"> <span> Atlas Search <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> If you use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/text/#mongodb-query-op.-text"> <code class="leafygreen-ui-1l06pbn"> $text </code> </a> , you can sort by descending relevance score using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/meta/#mongodb-expression-exp.-meta"> <code class="leafygreen-ui-1l06pbn"> { $meta: "textScore" } </code> </a> expression. </p> <p class="leafygreen-ui-1kp3ins"> The following sample document specifies a descending sort by the <code class="leafygreen-ui-1l06pbn"> "textScore" </code> metadata: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.users.find(\n { $text: { $search: \"operating\" } },\n { score: { $meta: \"textScore\" }}\n).sort({ score: { $meta: \"textScore\" } })","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">users</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$text</span>: <!-- -->{ <span class="lg-highlight-attr">$search</span>: <span class="lg-highlight-string">"operating"</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">score</span>: <!-- -->{ <span class="lg-highlight-attr">$meta</span>: <span class="lg-highlight-string">"textScore"</span> }}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">).<span class="lg-highlight-title lg-highlight-function">sort</span>(<!-- -->{ <span class="lg-highlight-attr">score</span>: <!-- -->{ <span class="lg-highlight-attr">$meta</span>: <span class="lg-highlight-string">"textScore"</span> } })</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> "textScore" </code> metadata sorts in descending order. </p> <p class="leafygreen-ui-1kp3ins"> For more information, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/meta/#mongodb-expression-exp.-meta"> <code class="leafygreen-ui-1l06pbn"> $meta </code> </a> for details. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-sort-by-array"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sort by an Array Field <a class="headerlink leafygreen-ui-1kepx47" href="#sort-by-an-array-field" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sort-by-an-array-field"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When MongoDB sorts documents by an array-value field, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-sort-key"> sort key </a> depends on whether the sort is ascending or descending: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In an ascending sort, the sort key is the lowest value in the array. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In a descending sort, the sort key is the highest value in the array. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The query filter does not affect sort key selection. </p> <p class="leafygreen-ui-1kp3ins"> For example, create a <code class="leafygreen-ui-1l06pbn"> shoes </code> collection with these documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.shoes.insertMany( [\n { _id: 'A', sizes: [ 7, 11 ] },\n { _id: 'B', sizes: [ 8, 9, 10 ] }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">shoes</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">'A'</span>, <span class="lg-highlight-attr">sizes</span>: <!-- -->[ <span class="lg-highlight-number">7</span>, <span class="lg-highlight-number">11</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">'B'</span>, <span class="lg-highlight-attr">sizes</span>: <!-- -->[ <span class="lg-highlight-number">8</span>, <span class="lg-highlight-number">9</span>, <span class="lg-highlight-number">10</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following queries sort the documents by the <code class="leafygreen-ui-1l06pbn"> sizes </code> field in ascending and descending order: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"// Ascending sort\ndb.shoes.find().sort( { sizes: 1 } )\n\n// Descending sort\ndb.shoes.find().sort( { sizes: -1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">// Ascending sort</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">shoes</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">sizes</span>: <span class="lg-highlight-number">1</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">// Descending sort</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">shoes</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">sizes</span>: <!-- -->-<span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Both of the preceding queries return the document with <code class="leafygreen-ui-1l06pbn"> _id: 'A' </code> first because sizes <code class="leafygreen-ui-1l06pbn"> 7 </code> and <code class="leafygreen-ui-1l06pbn"> 11 </code> are the lowest and highest in the entries in the <code class="leafygreen-ui-1l06pbn"> sizes </code> array, respectively. </p> <p class="leafygreen-ui-1kp3ins"> The following query finds shoes with sizes greater than 10 and sorts the results by shoe size in ascending order: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.shoes.find( { sizes: { $gte: 7 } } ).sort( { sizes: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">shoes</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">sizes</span>: <!-- -->{ <span class="lg-highlight-attr">$gte</span>: <span class="lg-highlight-number">7</span> } } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">sizes</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This query returns document with <code class="leafygreen-ui-1l06pbn"> _id: 'A' </code> first even though the filter includes a condition on <code class="leafygreen-ui-1l06pbn"> sizes </code> greater than <code class="leafygreen-ui-1l06pbn"> 7 </code> because the query filter does not affect sort key selection. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-sort-index-use"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sort and Index Use <a class="headerlink leafygreen-ui-1kepx47" href="#sort-and-index-use" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sort-and-index-use"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB can obtain the results of a sort operation from an index which includes the sort fields. MongoDB <em> may </em> use multiple indexes to support a sort operation <em> if </em> the sort uses the same indexes as the query predicate. </p> <p class="leafygreen-ui-1kp3ins"> If MongoDB cannot use an index or indexes to obtain the sort order, MongoDB must perform a blocking sort operation on the data. A blocking sort indicates that MongoDB must consume and process all input documents to the sort before returning results. Blocking sorts do not block concurrent operations on the collection or database. </p> <p class="leafygreen-ui-1kp3ins"> Sort operations that use an index often have better performance than blocking sorts. For more information on creating indexes to support sort operations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/sort-results-with-indexes/#std-label-sorting-with-indexes"> Use Indexes to Sort Query Results <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If MongoDB requires using more than 100 megabytes of system memory for the blocking sort operation, MongoDB returns an error <em> unless </em> the query specifies <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.allowDiskUse/#mongodb-method-cursor.allowDiskUse"> <code class="leafygreen-ui-1l06pbn"> cursor.allowDiskUse() </code> </a> . <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.allowDiskUse/#mongodb-method-cursor.allowDiskUse"> <code class="leafygreen-ui-1l06pbn"> allowDiskUse() </code> </a> allows MongoDB to use temporary files on disk to store data exceeding the 100 megabyte system memory limit while processing a blocking sort operation. </p> <p class="leafygreen-ui-1kp3ins"> To check if MongoDB must perform a blocking sort, append <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.explain/#mongodb-method-cursor.explain"> <code class="leafygreen-ui-1l06pbn"> cursor.explain() </code> </a> to the query and check the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/explain-results/#std-label-explain-results"> explain results </a> . If the query plan contains a <code class="leafygreen-ui-1l06pbn"> SORT </code> stage, then MongoDB must perform a blocking sort operation subject to the 100 megabyte memory limit. </p> <p class="leafygreen-ui-1kp3ins"> To prevent blocking sorts from consuming too much memory: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create an index to support the sort operation. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/sort-results-with-indexes/"> Use Indexes to Sort Query Results </a> for more information and examples. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Limit the amount of data to sort by using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.limit/#mongodb-method-cursor.limit"> <code class="leafygreen-ui-1l06pbn"> cursor.limit() </code> </a> with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-cursor.sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> cursor.sort() </code> </span> </a> . See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-sort-limit-results" target="_self"> <span> Limit Results </span> </a> for more information and examples. </p> </li> </ul> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/limits/#mongodb-limit-Sort-Operations"> Memory Limits on Sort Operations </a> </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-sort-limit-results"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Limit Results <a class="headerlink leafygreen-ui-1kepx47" href="#limit-results" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="limit-results"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-cursor.sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> sort() </code> </span> </a> in conjunction with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.limit/#mongodb-method-cursor.limit"> <code class="leafygreen-ui-1l06pbn"> limit() </code> </a> to return the first (in terms of the sort order) <code class="leafygreen-ui-1l06pbn"> k </code> documents, where <code class="leafygreen-ui-1l06pbn"> k </code> is the specified limit. </p> <p class="leafygreen-ui-1kp3ins"> If MongoDB cannot obtain the sort order via an index scan, then MongoDB uses a top-k sort algorithm. This algorithm buffers the first <code class="leafygreen-ui-1l06pbn"> k </code> results (or last, depending on the sort order) seen so far by the underlying index or collection access. If at any point the memory footprint of these <code class="leafygreen-ui-1l06pbn"> k </code> results exceeds 100 megabytes, the query will fail <em> unless </em> the query specifies <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.allowDiskUse/#mongodb-method-cursor.allowDiskUse"> <code class="leafygreen-ui-1l06pbn"> cursor.allowDiskUse() </code> . </a> </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/limits/#mongodb-limit-Sort-Operations"> Memory Limits on Sort Operations </a> </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-sort-with-projection"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Interaction with Projection <a class="headerlink leafygreen-ui-1kepx47" href="#interaction-with-projection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="interaction-with-projection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When a set of results are both sorted <em> and </em> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-projection"> projected </a> , the MongoDB query engine will always apply the sorting <strong> first </strong> . </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A collection <code class="leafygreen-ui-1l06pbn"> orders </code> contain the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ _id: 1, item: { category: \"cake\", type: \"chiffon\" }, amount: 10 }\n{ _id: 2, item: { category: \"cookies\", type: \"chocolate chip\" }, amount: 50 }\n{ _id: 3, item: { category: \"cookies\", type: \"chocolate chip\" }, amount: 15 }\n{ _id: 4, item: { category: \"cake\", type: \"lemon\" }, amount: 30 }\n{ _id: 5, item: { category: \"cake\", type: \"carrot\" }, amount: 20 }\n{ _id: 6, item: { category: \"brownies\", type: \"blondie\" }, amount: 10 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">item</span>: <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cake"</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chiffon"</span> }<!-- -->, <span class="lg-highlight-attr">amount</span>: <span class="lg-highlight-number">10</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">item</span>: <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cookies"</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate chip"</span> }<!-- -->, <span class="lg-highlight-attr">amount</span>: <span class="lg-highlight-number">50</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">item</span>: <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cookies"</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate chip"</span> }<!-- -->, <span class="lg-highlight-attr">amount</span>: <span class="lg-highlight-number">15</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">item</span>: <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cake"</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"lemon"</span> }<!-- -->, <span class="lg-highlight-attr">amount</span>: <span class="lg-highlight-number">30</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">item</span>: <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cake"</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"carrot"</span> }<!-- -->, <span class="lg-highlight-attr">amount</span>: <span class="lg-highlight-number">20</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-attr">item</span>: <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"brownies"</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"blondie"</span> }<!-- -->, <span class="lg-highlight-attr">amount</span>: <span class="lg-highlight-number">10</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following query, which returns all documents from the <code class="leafygreen-ui-1l06pbn"> orders </code> collection, does not specify a sort order: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.orders.find()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">orders</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The query returns the documents in indeterminate order: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"item\" : { \"category\" : \"cake\", \"type\" : \"chiffon\" }, \"amount\" : 10 }\n{ \"_id\" : 2, \"item\" : { \"category\" : \"cookies\", \"type\" : \"chocolate chip\" }, \"amount\" : 50 }\n{ \"_id\" : 3, \"item\" : { \"category\" : \"cookies\", \"type\" : \"chocolate chip\" }, \"amount\" : 15 }\n{ \"_id\" : 4, \"item\" : { \"category\" : \"cake\", \"type\" : \"lemon\" }, \"amount\" : 30 }\n{ \"_id\" : 5, \"item\" : { \"category\" : \"cake\", \"type\" : \"carrot\" }, \"amount\" : 20 }\n{ \"_id\" : 6, \"item\" : { \"category\" : \"brownies\", \"type\" : \"blondie\" }, \"amount\" : 10 }"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "_id" : 1, "item" : { "category" : "cake", "type" : "chiffon" }, "amount" : 10 }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ "_id" : 2, "item" : { "category" : "cookies", "type" : "chocolate chip" }, "amount" : 50 }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ "_id" : 3, "item" : { "category" : "cookies", "type" : "chocolate chip" }, "amount" : 15 }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ "_id" : 4, "item" : { "category" : "cake", "type" : "lemon" }, "amount" : 30 }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ "_id" : 5, "item" : { "category" : "cake", "type" : "carrot" }, "amount" : 20 }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ "_id" : 6, "item" : { "category" : "brownies", "type" : "blondie" }, "amount" : 10 }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following query specifies a sort on the <code class="leafygreen-ui-1l06pbn"> amount </code> field in descending order. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.orders.find().sort( { amount: -1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">orders</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">amount</span>: <!-- -->-<span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The query returns the following documents, in descending order of <code class="leafygreen-ui-1l06pbn"> amount </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 2, \"item\" : { \"category\" : \"cookies\", \"type\" : \"chocolate chip\" }, \"amount\" : 50 }\n{ \"_id\" : 4, \"item\" : { \"category\" : \"cake\", \"type\" : \"lemon\" }, \"amount\" : 30 }\n{ \"_id\" : 5, \"item\" : { \"category\" : \"cake\", \"type\" : \"carrot\" }, \"amount\" : 20 }\n{ \"_id\" : 3, \"item\" : { \"category\" : \"cookies\", \"type\" : \"chocolate chip\" }, \"amount\" : 15 }\n{ \"_id\" : 1, \"item\" : { \"category\" : \"cake\", \"type\" : \"chiffon\" }, \"amount\" : 10 }\n{ \"_id\" : 6, \"item\" : { \"category\" : \"brownies\", \"type\" : \"blondie\" }, \"amount\" : 10 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cookies"</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate chip"</span> }<!-- -->, <span class="lg-highlight-string">"amount"</span> <!-- -->: <span class="lg-highlight-number">50</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cake"</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"lemon"</span> }<!-- -->, <span class="lg-highlight-string">"amount"</span> <!-- -->: <span class="lg-highlight-number">30</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cake"</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"carrot"</span> }<!-- -->, <span class="lg-highlight-string">"amount"</span> <!-- -->: <span class="lg-highlight-number">20</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cookies"</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate chip"</span> }<!-- -->, <span class="lg-highlight-string">"amount"</span> <!-- -->: <span class="lg-highlight-number">15</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cake"</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chiffon"</span> }<!-- -->, <span class="lg-highlight-string">"amount"</span> <!-- -->: <span class="lg-highlight-number">10</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"brownies"</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"blondie"</span> }<!-- -->, <span class="lg-highlight-string">"amount"</span> <!-- -->: <span class="lg-highlight-number">10</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following query specifies the sort order using the fields from an embedded document <code class="leafygreen-ui-1l06pbn"> item </code> . The query sorts first by the <code class="leafygreen-ui-1l06pbn"> category </code> field in ascending order, and then within each <code class="leafygreen-ui-1l06pbn"> category </code> , by the <code class="leafygreen-ui-1l06pbn"> type </code> field in ascending order. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.orders.find().sort( { \"item.category\": 1, \"item.type\": 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">orders</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-string">"item.category"</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"item.type"</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The query returns the following documents, ordered first by the <code class="leafygreen-ui-1l06pbn"> category </code> field, and within each category, by the <code class="leafygreen-ui-1l06pbn"> type </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 6, \"item\" : { \"category\" : \"brownies\", \"type\" : \"blondie\" }, \"amount\" : 10 }\n{ \"_id\" : 5, \"item\" : { \"category\" : \"cake\", \"type\" : \"carrot\" }, \"amount\" : 20 }\n{ \"_id\" : 1, \"item\" : { \"category\" : \"cake\", \"type\" : \"chiffon\" }, \"amount\" : 10 }\n{ \"_id\" : 4, \"item\" : { \"category\" : \"cake\", \"type\" : \"lemon\" }, \"amount\" : 30 }\n{ \"_id\" : 2, \"item\" : { \"category\" : \"cookies\", \"type\" : \"chocolate chip\" }, \"amount\" : 50 }\n{ \"_id\" : 3, \"item\" : { \"category\" : \"cookies\", \"type\" : \"chocolate chip\" }, \"amount\" : 15 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"brownies"</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"blondie"</span> }<!-- -->, <span class="lg-highlight-string">"amount"</span> <!-- -->: <span class="lg-highlight-number">10</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cake"</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"carrot"</span> }<!-- -->, <span class="lg-highlight-string">"amount"</span> <!-- -->: <span class="lg-highlight-number">20</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cake"</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chiffon"</span> }<!-- -->, <span class="lg-highlight-string">"amount"</span> <!-- -->: <span class="lg-highlight-number">10</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cake"</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"lemon"</span> }<!-- -->, <span class="lg-highlight-string">"amount"</span> <!-- -->: <span class="lg-highlight-number">30</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cookies"</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate chip"</span> }<!-- -->, <span class="lg-highlight-string">"amount"</span> <!-- -->: <span class="lg-highlight-number">50</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"cookies"</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate chip"</span> }<!-- -->, <span class="lg-highlight-string">"amount"</span> <!-- -->: <span class="lg-highlight-number">15</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-return-storage-order"> </span> <span class="leafygreen-ui-1qnjd6d" id="std-label-return-natural-order"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Return in Natural Order <a class="headerlink leafygreen-ui-1kepx47" href="#return-in-natural-order" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="return-in-natural-order"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/meta/natural/#mongodb-operator-metaOp.-natural"> <code class="leafygreen-ui-1l06pbn"> $natural </code> </a> parameter returns items according to their <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-natural-order"> natural order </a> within the database. This ordering is an internal implementation feature, and you should not rely on any particular ordering of the documents. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Index Use <a class="headerlink leafygreen-ui-1kepx47" href="#index-use" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="index-use"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Queries that include a sort by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/meta/natural/#mongodb-operator-metaOp.-natural"> <code class="leafygreen-ui-1l06pbn"> $natural </code> </a> order do <strong> not </strong> use indexes to fulfill the query predicate with the following exception: If the query predicate is an equality condition on the <code class="leafygreen-ui-1l06pbn"> _id </code> field <code class="leafygreen-ui-1l06pbn"> { _id: &lt;value&gt; } </code> , then the query with the sort by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/meta/natural/#mongodb-operator-metaOp.-natural"> <code class="leafygreen-ui-1l06pbn"> $natural </code> </a> order can use the <code class="leafygreen-ui-1l06pbn"> _id </code> index. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/meta/natural/#mongodb-operator-metaOp.-natural"> <code class="leafygreen-ui-1l06pbn"> $natural </code> </a> </p> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/core/timeseries/timeseries-build-materialized-views/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Build Materialized Views on Top of Time Series Data <a class="headerlink leafygreen-ui-1kepx47" href="#build-materialized-views-on-top-of-time-series-data" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="build-materialized-views-on-top-of-time-series-data"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> Materialized views on time series data are useful for: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> archiving </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> analytics </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> facilitating data access for teams that cannot access the raw data </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> To create an <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/materialized-views/"> On-Demand Materialized view </a> , use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/merge/#mongodb-pipeline-pipe.-merge"> <code class="leafygreen-ui-1l06pbn"> $merge </code> </a> aggregation pipeline stage to transform and store your data: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.weather.aggregate([\n {\n $project: {\n date: {\n $dateToParts: { date: \"$timestamp\" }\n },\n temp: 1\n }\n },\n {\n $group: {\n _id: {\n date: {\n year: \"$date.year\",\n month: \"$date.month\",\n day: \"$date.day\"\n }\n },\n avgTmp: { $avg: \"$temp\" }\n }\n }, {\n $merge: { into: \"dailytemperatureaverages\", whenMatched: \"replace\" }\n }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">weather</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$dateToParts</span>: <!-- -->{ <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-string">"$timestamp"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">temp</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$group</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">year</span>: <span class="lg-highlight-string">"$date.year"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">month</span>: <span class="lg-highlight-string">"$date.month"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">day</span>: <span class="lg-highlight-string">"$date.day"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">avgTmp</span>: <!-- -->{ <span class="lg-highlight-attr">$avg</span>: <span class="lg-highlight-string">"$temp"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->, <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$merge</span>: <!-- -->{ <span class="lg-highlight-attr">into</span>: <span class="lg-highlight-string">"dailytemperatureaverages"</span>, <span class="lg-highlight-attr">whenMatched</span>: <span class="lg-highlight-string">"replace"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The preceding pipeline, will create or update the <code class="leafygreen-ui-1l06pbn"> dailytemperatureaverages </code> collection with all daily temperature averages based on the <code class="leafygreen-ui-1l06pbn"> weather </code> collection. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> It is not possible to natively schedule the refreshing of these materialized views. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on materialized views, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/materialized-views/"> On-Demand Materialized Views <!-- --> . </a> </p> </section>
https://www.mongodb.com/docs/manual/core/timeseries/timeseries-aggregations-operators/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Aggregations and Operators Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#aggregations-and-operators-considerations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="aggregations-and-operators-considerations"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#-geonear" target="_self"> <span> $geonear </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#-merge" target="_self"> <span> $merge </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#-out" target="_self"> <span> $out </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#frequently-used-operations" target="_self"> <span> Frequently Used Operations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#calculate-average-price-per-month" target="_self"> <span> Calculate Average Price per Month </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#calculate-a-rolling-average-over-30-days" target="_self"> <span> Calculate a Rolling Average Over 30 Days </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> Some aggregation stages and operators require special considerations when you use them with <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-manual-timeseries-landing"> time series collections <!-- --> . </a> </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> $geonear <a class="headerlink leafygreen-ui-1kepx47" href="#-geonear" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-geonear"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Time series collections only support the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/geoNear/#mongodb-pipeline-pipe.-geoNear"> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </a> aggregation stage for sorting <a class="leafygreen-ui-tqgtui" href="/docs/manual/geospatial-queries/#std-label-geospatial-queries"> geospatial data </a> from queries against <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere </a> indexes. You can't use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/near/#mongodb-query-op.-near"> <code class="leafygreen-ui-1l06pbn"> $near </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/nearSphere/#mongodb-query-op.-nearSphere"> <code class="leafygreen-ui-1l06pbn"> $nearSphere </code> </a> operators on time series collections. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> $merge <a class="headerlink leafygreen-ui-1kepx47" href="#-merge" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-merge"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You cannot use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/merge/#mongodb-pipeline-pipe.-merge"> <code class="leafygreen-ui-1l06pbn"> $merge </code> </a> aggregation stage to add data from another collection to a time series collection. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> $out <a class="headerlink leafygreen-ui-1kepx47" href="#-out" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-out"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 7.0, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/out/#mongodb-pipeline-pipe.-out"> <code class="leafygreen-ui-1l06pbn"> $out </code> </a> aggregation stage to write documents to a time series collection. For more information, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-migrate-data-into-timeseries-collection/#std-label-migrate-data-into-a-timeseries-collection"> Migrate Data into a Time Series Collection <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Frequently Used Operations <a class="headerlink leafygreen-ui-1kepx47" href="#frequently-used-operations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="frequently-used-operations"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following aggregation pipeline operators and stages are often used to analyze time series data: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/dateAdd/#mongodb-expression-exp.-dateAdd"> <code class="leafygreen-ui-1l06pbn"> $dateAdd </code> </a> : Adds a specified amount of time to a Date object. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/dateDiff/#mongodb-expression-exp.-dateDiff"> <code class="leafygreen-ui-1l06pbn"> $dateDiff </code> </a> : Returns the time difference between two dates. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/dateTrunc/#mongodb-expression-exp.-dateTrunc"> <code class="leafygreen-ui-1l06pbn"> $dateTrunc </code> </a> : Returns a date that has been truncated to the specific unit. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> : Runs calculations on documents in a given window. </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Calculate Average Price per Month <a class="headerlink leafygreen-ui-1kepx47" href="#calculate-average-price-per-month" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="calculate-average-price-per-month"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Consider a <code class="leafygreen-ui-1l06pbn"> dowJonesTickerData </code> collection that contains documents with the following structure: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n date: ISODate(\"2020-01-03T05:00:00.000Z\"),\n symbol: 'AAPL',\n volume: 146322800,\n open: 74.287498,\n adjClose: 73.486023,\n high: 75.144997,\n low: 74.125,\n close: 74.357498\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-01-03T05:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">symbol</span>: <span class="lg-highlight-string">'AAPL'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">volume</span>: <span class="lg-highlight-number">146322800</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">open</span>: <span class="lg-highlight-number">74.287498</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">adjClose</span>: <span class="lg-highlight-number">73.486023</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">high</span>: <span class="lg-highlight-number">75.144997</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">low</span>: <span class="lg-highlight-number">74.125</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">close</span>: <span class="lg-highlight-number">74.357498</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This aggregation pipeline performs the following actions: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/dateTrunc/#mongodb-expression-exp.-dateTrunc"> <code class="leafygreen-ui-1l06pbn"> $dateTrunc </code> </a> to truncate each document's <code class="leafygreen-ui-1l06pbn"> date </code> to the appropriate month. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> to group the documents by month and symbol. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/avg/#mongodb-group-grp.-avg"> <code class="leafygreen-ui-1l06pbn"> $avg </code> </a> to calculate the average price per month. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.dowJonesTickerData.aggregate( [ {\n $group: {\n _id: {\n firstDayOfMonth: {\n $dateTrunc: {\n date: \"$date\",\n unit: \"month\"\n }\n },\n symbol: \"$symbol\"\n },\n avgMonthClose: {\n $avg: \"$close\"\n }\n }\n} ] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">dowJonesTickerData</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[ <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$group</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">firstDayOfMonth</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$dateTrunc</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-string">"$date"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">unit</span>: <span class="lg-highlight-string">"month"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">symbol</span>: <span class="lg-highlight-string">"$symbol"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">avgMonthClose</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$avg</span>: <span class="lg-highlight-string">"$close"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} ] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The pipeline returns a set of documents where each document contains the average closing price per month for a particular stock. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: {\n firstDayOfMonth: ISODate(\"2020-06-01T00:00:00.000Z\"),\n symbol: 'GOOG'\n },\n avgMonthClose: 1431.0477184545455\n},\n{\n _id: {\n firstDayOfMonth: ISODate(\"2021-07-01T00:00:00.000Z\"),\n symbol: 'MDB'\n },\n avgMonthClose: 352.7314293333333\n},\n{\n _id: {\n firstDayOfMonth: ISODate(\"2021-06-01T00:00:00.000Z\"),\n symbol: 'MSFT'\n },\n avgMonthClose: 259.01818086363636\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">firstDayOfMonth</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-06-01T00:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">symbol</span>: <span class="lg-highlight-string">'GOOG'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">avgMonthClose</span>: <span class="lg-highlight-number">1431.0477184545455</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">firstDayOfMonth</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-07-01T00:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">symbol</span>: <span class="lg-highlight-string">'MDB'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">avgMonthClose</span>: <span class="lg-highlight-number">352.7314293333333</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">firstDayOfMonth</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-06-01T00:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">symbol</span>: <span class="lg-highlight-string">'MSFT'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">avgMonthClose</span>: <span class="lg-highlight-number">259.01818086363636</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Calculate a Rolling Average Over 30 Days <a class="headerlink leafygreen-ui-1kepx47" href="#calculate-a-rolling-average-over-30-days" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="calculate-a-rolling-average-over-30-days"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Consider a <code class="leafygreen-ui-1l06pbn"> dowJonesTickerData </code> collection that contains documents with the following structure: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n date: ISODate(\"2020-01-03T05:00:00.000Z\"),\n symbol: 'AAPL',\n volume: 146322800,\n open: 74.287498,\n adjClose: 73.486023,\n high: 75.144997,\n low: 74.125,\n close: 74.357498\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-01-03T05:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">symbol</span>: <span class="lg-highlight-string">'AAPL'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">volume</span>: <span class="lg-highlight-number">146322800</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">open</span>: <span class="lg-highlight-number">74.287498</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">adjClose</span>: <span class="lg-highlight-number">73.486023</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">high</span>: <span class="lg-highlight-number">75.144997</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">low</span>: <span class="lg-highlight-number">74.125</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">close</span>: <span class="lg-highlight-number">74.357498</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This aggregation pipeline performs the following operations: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/setWindowFields/#mongodb-pipeline-pipe.-setWindowFields"> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </a> to specify a window of 30 days. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Calculates a rolling average of the closing price over the last 30 days for each stock. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.dowJonesTickerData.aggregate( [\n { $setWindowFields: {\n partitionBy: { symbol : \"$symbol\" } ,\n sortBy: { date: 1 },\n output: {\n averageMonthClosingPrice: {\n $avg : \"$close\",\n window : { range : [-1, \"current\"], unit : \"month\" }\n\n }\n }\n } }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">dowJonesTickerData</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <!-- -->{ <!-- -->symbol <!-- -->: <span class="lg-highlight-string">"$symbol"</span> } <!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">averageMonthClosingPrice</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->$avg<!-- --> <!-- -->: <span class="lg-highlight-string">"$close"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-variable lg-highlight-language">window</span> <!-- -->: <!-- -->{ <!-- -->range <!-- -->: <!-- -->[<!-- -->-<span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"current"</span>]<!-- -->, <!-- -->unit <!-- -->: <span class="lg-highlight-string">"month"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The pipeline returns a set of documents where each document includes a <code class="leafygreen-ui-1l06pbn"> $averageMonthClosingPrice </code> field that contains the average of the previous month's closing price for that stock symbol. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n date: ISODate(\"2020-01-29T05:00:00.000Z\"),\n symbol: 'AAPL',\n volume: 216229200,\n adjClose: 80.014801,\n low: 80.345001,\n high: 81.962502,\n open: 81.112503,\n close: 81.084999,\n averageMonthClosingPrice: 77.63137520000001\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">date</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-01-29T05:00:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">symbol</span>: <span class="lg-highlight-string">'AAPL'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">volume</span>: <span class="lg-highlight-number">216229200</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">adjClose</span>: <span class="lg-highlight-number">80.014801</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">low</span>: <span class="lg-highlight-number">80.345001</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">high</span>: <span class="lg-highlight-number">81.962502</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">open</span>: <span class="lg-highlight-number">81.112503</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">close</span>: <span class="lg-highlight-number">81.084999</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">averageMonthClosingPrice</span>: <span class="lg-highlight-number">77.63137520000001</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/core/timeseries/timeseries-check-type/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> List Time Series Collections in a Database <a class="headerlink leafygreen-ui-1kepx47" href="#list-time-series-collections-in-a-database" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="list-time-series-collections-in-a-database"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#procedure" target="_self"> <span> Procedure </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#output" target="_self"> <span> Output </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> You can output a list of collections in a database and filter the results by a variety of properties, including collection type. You can use this functionality to list all time series collections in a database. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#procedure" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="procedure"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To list all time series collections in a database, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/listCollections/#mongodb-dbcommand-dbcmd.listCollections"> <code class="leafygreen-ui-1l06pbn"> listCollections </code> </a> command with a filter for <code class="leafygreen-ui-1l06pbn"> { type: "timeseries" } </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand( {\n listCollections: 1,\n filter: { type: \"timeseries\" }\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">listCollections</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">filter</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"timeseries"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Output <a class="headerlink leafygreen-ui-1kepx47" href="#output" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="output"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> For time series collections, the output includes: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> type: 'timeseries' </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> options: { timeseries: { ... } } </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n cursor: {\n id: Long(\"0\"),\n ns: 'test.$cmd.listCollections',\n firstBatch: [\n {\n name: 'weather',\n type: 'timeseries',\n options: {\n timeseries: {\n timeField: 'timestamp',\n metaField: 'metadata',\n granularity: 'hours',\n bucketMaxSpanSeconds: 2592000\n }\n },\n info: { readOnly: false }\n }\n ]\n },\n ok: 1\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">cursor</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">id</span>: <span class="lg-highlight-title lg-highlight-class">Long</span>(<span class="lg-highlight-string">"0"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">ns</span>: <span class="lg-highlight-string">'test.$cmd.listCollections'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">firstBatch</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">'weather'</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">'timeseries'</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">options</span>: <!-- -->{</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeseries</span>: <!-- -->{</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeField</span>: <span class="lg-highlight-string">'timestamp'</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metaField</span>: <span class="lg-highlight-string">'metadata'</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">granularity</span>: <span class="lg-highlight-string">'hours'</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bucketMaxSpanSeconds</span>: <span class="lg-highlight-number">2592000</span></td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">info</span>: <!-- -->{ <span class="lg-highlight-attr">readOnly</span>: <span class="lg-highlight-literal">false</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">ok</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/removeShard/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> removeShard <a class="headerlink leafygreen-ui-1kepx47" href="#removeshard" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="removeshard"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> removeShard </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.removeShard" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-dbcommand-dbcmd.removeShard"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Removes a shard from a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-sharded-cluster"> sharded cluster </a> . When you run <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.removeShard" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </span> </a> , MongoDB drains the shard by using the balancer to move the shard's chunks to other shards in the cluster. Once the shard is drained, MongoDB removes the shard from the cluster. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is not supported in M10+ clusters or serverless instances. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand(\n {\n removeShard : &lt;shardtoremove&gt;\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->removeShard <!-- -->: &lt;<!-- -->shardToRemove<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> No Cluster Back Ups During Shard Removal <a class="headerlink leafygreen-ui-1kepx47" href="#no-cluster-back-ups-during-shard-removal" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="no-cluster-back-ups-during-shard-removal"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You cannot back up the cluster data during shard removal. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Concurrent <code class="leafygreen-ui-1l06pbn"> removeShard </code> Operations <a class="headerlink leafygreen-ui-1kepx47" href="#concurrent-removeshard-operations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="concurrent-removeshard-operations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can have more than one <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.removeShard" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </span> </a> operation in progress. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Access Requirements <a class="headerlink leafygreen-ui-1kepx47" href="#access-requirements" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="access-requirements"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you have <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.authorization"> <code class="leafygreen-ui-1l06pbn"> authorization </code> </a> enabled, you must have the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-clusterManager"> <code class="leafygreen-ui-1l06pbn"> clusterManager </code> </a> role or any role that includes the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-removeShard"> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </a> action. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Database Migration Requirements <a class="headerlink leafygreen-ui-1kepx47" href="#database-migration-requirements" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="database-migration-requirements"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Each database in a sharded cluster has a primary shard. If the shard you want to remove is also the primary of one of the cluster's databases, then you must manually move the databases to a new shard after migrating all data from the shard. See the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/movePrimary/#mongodb-dbcommand-dbcmd.movePrimary"> <code class="leafygreen-ui-1l06pbn"> movePrimary </code> </a> command and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/remove-shards-from-cluster/"> Remove Shards from a Sharded Cluster </a> for more information. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Chunk Balancing <a class="headerlink leafygreen-ui-1kepx47" href="#chunk-balancing" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="chunk-balancing"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When you remove a shard in a cluster with an uneven chunk distribution, the balancer first removes the chunks from the draining shard and then balances the remaining uneven chunk distribution. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/balancerCollectionStatus/#mongodb-dbcommand-dbcmd.balancerCollectionStatus"> <code class="leafygreen-ui-1l06pbn"> balancerCollectionStatus </code> </a> </p> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Write Concern <a class="headerlink leafygreen-ui-1kepx47" href="#write-concern" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="write-concern"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> converts the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern"> write concern </a> of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.removeShard" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </span> </a> command to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Change Streams <a class="headerlink leafygreen-ui-1kepx47" href="#change-streams" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="change-streams"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Removing a shard may cause an open <a class="leafygreen-ui-tqgtui" href="/docs/manual/changeStreams/#std-label-changeStreams"> change stream cursor </a> to close, and the closed change stream cursor may not be fully resumable. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> DDL Operations <a class="headerlink leafygreen-ui-1kepx47" href="#ddl-operations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="ddl-operations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you run <code class="leafygreen-ui-1l06pbn"> removeShard </code> while your cluster executes a DDL operation (operation that modifies a collection such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/reshardCollection/#mongodb-dbcommand-dbcmd.reshardCollection"> <code class="leafygreen-ui-1l06pbn"> reshardCollection </code> </a> ), <code class="leafygreen-ui-1l06pbn"> removeShard </code> only executes after the concurrent DDL operation finishes. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-removeShard-examples"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> From <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.removeShard" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </span> </a> operation resembles the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { removeShard : \"bristol01\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <!-- -->removeShard <!-- -->: <span class="lg-highlight-string">"bristol01"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Replace <code class="leafygreen-ui-1l06pbn"> bristol01 </code> with the name of the shard to remove. When you run <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.removeShard" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </span> </a> , the command returns with a message that resembles the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"msg\" : \"draining started successfully\",\n \"state\" : \"started\",\n \"shard\" : \"bristol01\",\n \"note\" : \"you need to drop or movePrimary these databases\",\n \"dbsToMove\" : [\n \"fizz\",\n \"buzz\"\n ],\n \"ok\" : 1,\n \"operationTime\" : Timestamp(1575398919, 2),\n \"$clusterTime\" : {\n \"clusterTime\" : Timestamp(1575398919, 2),\n \"signature\" : {\n \"hash\" : BinData(0,\"Oi68poWCFCA7b9kyhIcg+TzaGiA=\"),\n \"keyId\" : NumberLong(\"6766255701040824328\")\n }\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"msg"</span> <!-- -->: <span class="lg-highlight-string">"draining started successfully"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"started"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"shard"</span> <!-- -->: <span class="lg-highlight-string">"bristol01"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"note"</span> <!-- -->: <span class="lg-highlight-string">"you need to drop or movePrimary these databases"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dbsToMove"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"fizz"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"buzz"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ok"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"operationTime"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">Timestamp</span>(<span class="lg-highlight-number">1575398919</span>, <span class="lg-highlight-number">2</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$clusterTime"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"clusterTime"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">Timestamp</span>(<span class="lg-highlight-number">1575398919</span>, <span class="lg-highlight-number">2</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"signature"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"hash"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">BinData</span>(<span class="lg-highlight-number">0</span>,<span class="lg-highlight-string">"Oi68poWCFCA7b9kyhIcg+TzaGiA="</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keyId"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-string">"6766255701040824328"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The balancer begins migrating ("draining") chunks from the shard named <code class="leafygreen-ui-1l06pbn"> bristol01 </code> to other shards in the cluster. These migrations happen slowly in order to avoid placing undue load on the cluster. </p> <p class="leafygreen-ui-1kp3ins"> The output includes the field <code class="leafygreen-ui-1l06pbn"> dbsToMove </code> indicating the databases for which <code class="leafygreen-ui-1l06pbn"> bristol01 </code> is the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-shards/#std-label-primary-shard"> primary shard </a> . After the balancer moves all chunks and after all collections are moved by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/moveCollection/#mongodb-dbcommand-dbcmd.moveCollection"> <code class="leafygreen-ui-1l06pbn"> moveCollection </code> </a> , you must <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/movePrimary/#mongodb-dbcommand-dbcmd.movePrimary"> <code class="leafygreen-ui-1l06pbn"> movePrimary </code> </a> for the database(s). </p> <p class="leafygreen-ui-1kp3ins"> If you run the command again, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.removeShard" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </span> </a> returns the current status of the process. For example, if the operation is in an <code class="leafygreen-ui-1l06pbn"> ongoing </code> state, the command returns an output that resembles the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"msg\" : \"draining ongoing\",\n \"state\" : \"ongoing\",\n \"remaining\" : {\n \"chunks\" : NumberLong(2),\n \"dbs\" : NumberLong(2),\n \"jumboChunks\" : NumberLong(0)\n },\n \"note\" : \"you need to drop or movePrimary these databases\",\n \"dbsToMove\" : [\n \"fizz\",\n \"buzz\"\n ],\n \"ok\" : 1,\n \"operationTime\" : Timestamp(1575399086, 1655),\n \"$clusterTime\" : {\n \"clusterTime\" : Timestamp(1575399086, 1655),\n \"signature\" : {\n \"hash\" : BinData(0,\"XBrTmjMMe82fUtVLRm13GBVtRE8=\"),\n \"keyId\" : NumberLong(\"6766255701040824328\")\n }\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"msg"</span> <!-- -->: <span class="lg-highlight-string">"draining ongoing"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"ongoing"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"remaining"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"chunks"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">2</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dbs"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">2</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"jumboChunks"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">0</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"note"</span> <!-- -->: <span class="lg-highlight-string">"you need to drop or movePrimary these databases"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dbsToMove"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"fizz"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"buzz"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ok"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"operationTime"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">Timestamp</span>(<span class="lg-highlight-number">1575399086</span>, <span class="lg-highlight-number">1655</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$clusterTime"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"clusterTime"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">Timestamp</span>(<span class="lg-highlight-number">1575399086</span>, <span class="lg-highlight-number">1655</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"signature"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"hash"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">BinData</span>(<span class="lg-highlight-number">0</span>,<span class="lg-highlight-string">"XBrTmjMMe82fUtVLRm13GBVtRE8="</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keyId"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-string">"6766255701040824328"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the output, the <code class="leafygreen-ui-1l06pbn"> remaining </code> field includes the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:10%"/> <col style="width:90%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> chunks </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Total number of chunks currently remaining on the shard. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> dbs </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Total number of databases whose <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-shards/#std-label-primary-shard"> primary shard </a> is the shard. These databases are specified in the <code class="leafygreen-ui-1l06pbn"> dbsToMove </code> output field. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> jumboChunks </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Of the total number of <code class="leafygreen-ui-1l06pbn"> chunks </code> , the number that are <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-data-partitioning/#std-label-jumbo-chunk"> jumbo <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If the <code class="leafygreen-ui-1l06pbn"> jumboChunks </code> is greater than 0, wait until only the <code class="leafygreen-ui-1l06pbn"> jumboChunks </code> remain on the shard. Once only the jumbo chunks remain, you must manually clear the jumbo flag before the draining can complete. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/clear-jumbo-flag/"> Clear <code class="leafygreen-ui-1l06pbn"> jumbo </code> Flag <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> After the <code class="leafygreen-ui-1l06pbn"> jumbo </code> flag clears, the balancer can migrate these chunks. For details on the migration procedure, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-balancer-administration/#std-label-range-migration-procedure"> Range Migration Procedure <!-- --> . </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> Continue checking the status of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.removeShard" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </span> </a> command (i.e. rerun the command) until the number of chunks remaining is <code class="leafygreen-ui-1l06pbn"> 0 </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"msg\" : \"draining ongoing\",\n \"state\" : \"ongoing\",\n \"remaining\" : {\n \"chunks\" : NumberLong(0), // All chunks have moved\n \"dbs\" : NumberLong(2),\n \"jumboChunks\" : NumberLong(0)\n },\n \"note\" : \"you need to drop or movePrimary these databases\",\n \"dbsToMove\" : [\n \"fizz\",\n \"buzz\"\n ],\n \"ok\" : 1,\n \"operationTime\" : Timestamp(1575400343, 1),\n \"$clusterTime\" : {\n \"clusterTime\" : Timestamp(1575400343, 1),\n \"signature\" : {\n \"hash\" : BinData(0,\"9plu5B/hw4uWAgEmjjBP3syw1Zk=\"),\n \"keyId\" : NumberLong(\"6766255701040824328\")\n }\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"msg"</span> <!-- -->: <span class="lg-highlight-string">"draining ongoing"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"ongoing"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"remaining"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"chunks"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">0</span>)<!-- -->, <span class="lg-highlight-comment">//</span><span class="lg-highlight-comment"> All chunks have </span><span class="lg-highlight-comment">moved</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dbs"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">2</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"jumboChunks"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-number">0</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"note"</span> <!-- -->: <span class="lg-highlight-string">"you need to drop or movePrimary these databases"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dbsToMove"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"fizz"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"buzz"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ok"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"operationTime"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">Timestamp</span>(<span class="lg-highlight-number">1575400343</span>, <span class="lg-highlight-number">1</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$clusterTime"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"clusterTime"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">Timestamp</span>(<span class="lg-highlight-number">1575400343</span>, <span class="lg-highlight-number">1</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"signature"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"hash"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">BinData</span>(<span class="lg-highlight-number">0</span>,<span class="lg-highlight-string">"9plu5B/hw4uWAgEmjjBP3syw1Zk="</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keyId"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-string">"6766255701040824328"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> After all chunks have been drained from the shard, if you have <code class="leafygreen-ui-1l06pbn"> dbsToMove </code> , you can either <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/movePrimary/#mongodb-dbcommand-dbcmd.movePrimary"> <code class="leafygreen-ui-1l06pbn"> movePrimary </code> </a> for those databases or alternatively, drop the databases (which deletes the associated data files). </p> <p class="leafygreen-ui-1kp3ins"> After the balancer completes moving all chunks off the shard and you have handled the <code class="leafygreen-ui-1l06pbn"> dbsToMove </code> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.removeShard" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </span> </a> can finish. Running <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.removeShard" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </span> </a> again returns output that resembles the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"msg\" : \"removeshard completed successfully\",\n \"state\" : \"completed\",\n \"shard\" : \"bristol01\",\n \"ok\" : 1,\n \"operationTime\" : Timestamp(1575400370, 2),\n \"$clusterTime\" : {\n \"clusterTime\" : Timestamp(1575400370, 2),\n \"signature\" : {\n \"hash\" : BinData(0,\"JjSRciHECXDBXo0e5nJv9mdRG8M=\"),\n \"keyId\" : NumberLong(\"6766255701040824328\")\n }\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"msg"</span> <!-- -->: <span class="lg-highlight-string">"removeshard completed successfully"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"completed"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"shard"</span> <!-- -->: <span class="lg-highlight-string">"bristol01"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ok"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"operationTime"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">Timestamp</span>(<span class="lg-highlight-number">1575400370</span>, <span class="lg-highlight-number">2</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$clusterTime"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"clusterTime"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">Timestamp</span>(<span class="lg-highlight-number">1575400370</span>, <span class="lg-highlight-number">2</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"signature"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"hash"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">BinData</span>(<span class="lg-highlight-number">0</span>,<span class="lg-highlight-string">"JjSRciHECXDBXo0e5nJv9mdRG8M="</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keyId"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">NumberLong</span>(<span class="lg-highlight-string">"6766255701040824328"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/core/index-ttl/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> TTL Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#ttl-indexes" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="ttl-indexes"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#create-a-ttl-index" target="_self"> <span> Create a TTL Index </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#convert-a-non-ttl-single-field-index-into-a-ttl-index" target="_self"> <span> Convert a non-TTL single-field Index into a TTL Index </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#change-the-expireafterseconds-value-for-a-ttl-index" target="_self"> <span> Change the <code class="css-1kekw28 e1wawog0"> expireAfterSeconds </code> value for a TTL Index </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#restrictions" target="_self"> <span> Restrictions </span> </a> </li> </ul> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If you are removing documents to save on storage costs, consider <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/online-archive/manage-online-archive/" target="_self"> <span> Online Archive </span> </a> in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/cloud?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> . Online Archive automatically archives infrequently accessed data to fully-managed S3 buckets for cost-effective data tiering. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> TTL indexes are special single-field indexes that MongoDB can use to automatically remove documents from a collection after a certain amount of time or at a specific clock time. Data expiration is useful for certain types of information like machine generated event data, logs, and session information that only need to persist in a database for a finite amount of time. </p> <a class="css-53dzkk" href="https://www.mongodb.com/docs/manual/tutorial/expire-data/#expire-documents-in-the-mongodb-atlas-ui"> <div class="css-z0l49d"> <div class="css-fw7ipj"> <svg aria-label="Cloud Icon" class="leafygreen-ui-1t2jgtk" fill="none" height="16" role="img" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path d="M12.571 8.143c0 1.775-.899 3.34-2.267 4.264l-.014.01a5.12 5.12 0 0 1-2.861.869H2.857a2.857 2.857 0 0 1-.545-5.663 5.144 5.144 0 0 1 10.26.52ZM13.821 8.143a6.38 6.38 0 0 1-2.358 4.96 3.429 3.429 0 1 0 2.17-6.506c.123.494.188 1.013.188 1.546Z" fill="currentColor"> </path> </svg> </div> <p class="leafygreen-ui-1kp3ins"> You can <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/expire-data/#std-label-expire-data-atlas-ui"> create and manage TTL indexes in the UI </a> for deployments hosted in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas. </span> </a> </p> </div> </a> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Create a TTL Index <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-ttl-index" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-a-ttl-index"> </div> </a> </h2> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> After you create a TTL index, it might have a very large number of qualifying documents to delete at once. This large workload might cause performance issues on the server. To avoid these issues, plan to create the index during off hours, or delete qualifying documents in batches before you create the index for future documents. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> To create a TTL index, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex"> <code class="leafygreen-ui-1l06pbn"> createIndex() </code> </a> . Specify an index field that is either a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-date"> date type </a> or an array that contains date type values. Use the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> option to specify a TTL value in seconds. </p> <p class="leafygreen-ui-1kp3ins"> The TTL index <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> value must be within <code class="leafygreen-ui-1l06pbn"> 0 </code> and <code class="leafygreen-ui-1l06pbn"> 2147483647 </code> inclusive. </p> <p class="leafygreen-ui-1kp3ins"> For example, to create a TTL index on the <code class="leafygreen-ui-1l06pbn"> lastModifiedDate </code> field of the <code class="leafygreen-ui-1l06pbn"> eventlog </code> collection with a TTL value of <code class="leafygreen-ui-1l06pbn"> 3600 </code> seconds, use the following operation in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> : </span> </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.eventlog.createIndex(\n { \"lastModifiedDate\": 1 },\n { expireAfterSeconds: 3600 }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">eventlog</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"lastModifiedDate"</span>: <span class="lg-highlight-number">1</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-attr">expireAfterSeconds</span>: <span class="lg-highlight-number">3600</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 6.3, you can create partial TTL indexes on <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-manual-timeseries-landing"> time series collections </a> . These indexes use the collection <code class="leafygreen-ui-1l06pbn"> timeField </code> as the key field, and require a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-partial/#std-label-index-type-partial"> partial filter expression </a> on the <code class="leafygreen-ui-1l06pbn"> metaField </code> . </p> <p class="leafygreen-ui-1kp3ins"> Time series collections include an optional <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> field. If you don't set <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> , a TTL index with a <code class="leafygreen-ui-1l06pbn"> partialFilterExpression </code> lets you set an expiration period for documents that match the filter. If you do set <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> , a partial TTL index lets you set a different, shorter expiration period for matching documents. You can only create a <code class="leafygreen-ui-1l06pbn"> partialFilterExpression </code> on the <code class="leafygreen-ui-1l06pbn"> metaField </code> . </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> value of the collection is lower than the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> of the partial TTL index, the collection deletes documents after the shorter time, so the TTL index has no effect. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> If a time series collection contains documents with <code class="leafygreen-ui-1l06pbn"> timeField </code> timestamps before <code class="leafygreen-ui-1l06pbn"> 1970-01-01T00:00:00.000Z </code> or after <code class="leafygreen-ui-1l06pbn"> 2038-01-19T03:14:07.000Z </code> , no documents are deleted from the collection by the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-TTL"> TTL "time to live" </a> feature. </p> <p class="leafygreen-ui-1kp3ins"> This weather data time series collection deletes documents after 24 hours: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection(\n \"weather24h\",\n {\n timeseries: {\n timeField: \"timestamp\",\n metaField: \"sensor\",\n granularity: \"hours\"\n },\n expireAfterSeconds: 86400\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"weather24h"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeseries</span>: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeField</span>: <span class="lg-highlight-string">"timestamp"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metaField</span>: <span class="lg-highlight-string">"sensor"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">granularity</span>: <span class="lg-highlight-string">"hours"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">expireAfterSeconds</span>: <span class="lg-highlight-number">86400</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This TTL index deletes documents from the MongoDB NYC headquarters weather sensor after 1 hour, instead of 24 hours: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.eventlog.createIndex(\n { \"timestamp\": 1 },\n { partialFilterExpression: { \"sensor\": { $eq: \"40.761873, -73.984287\" } } },\n { expireAfterSeconds: 3600 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">eventlog</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-string">"timestamp"</span>: <span class="lg-highlight-number">1</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-attr">partialFilterExpression</span>: { <span class="lg-highlight-string">"sensor"</span>: { <span class="lg-highlight-attr">$eq</span>: <span class="lg-highlight-string">"40.761873, -73.984287"</span> } } },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> { <span class="lg-highlight-attr">expireAfterSeconds</span>: <span class="lg-highlight-number">3600</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-convert-non-ttl-single-field-index-into-ttl"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Convert a non-TTL single-field Index into a TTL Index <a class="headerlink leafygreen-ui-1kepx47" href="#convert-a-non-ttl-single-field-index-into-a-ttl-index" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="convert-a-non-ttl-single-field-index-into-a-ttl-index"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.1, you can add the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> option to an existing single-field index. To change a non-TTL single-field index to a TTL index, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> database command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand({\n \"collMod\": &lt;collname&gt;,\n \"index\": {\n \"keyPattern\": &lt;keypattern&gt;,\n \"expireAfterSeconds\": &lt;number&gt;\n }\n})","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>({</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"collMod"</span>: &lt;collName&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"index"</span>: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keyPattern"</span>: &lt;keyPattern&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"expireAfterSeconds"</span>: &lt;number&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example converts a non-TTL single-field index with the pattern <code class="leafygreen-ui-1l06pbn"> { "lastModifiedDate": 1 } </code> into a TTL index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand({\n \"collMod\": \"tickets\",\n \"index\": {\n \"keyPattern\": { \"lastModifiedDate\": 1 },\n \"expireAfterSeconds\": 100\n }\n})","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>({</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"collMod"</span>: <span class="lg-highlight-string">"tickets"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"index"</span>: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keyPattern"</span>: { <span class="lg-highlight-string">"lastModifiedDate"</span>: <span class="lg-highlight-number">1</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"expireAfterSeconds"</span>: <span class="lg-highlight-number">100</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-change-ttl-expireafterseconds-value"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Change the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> value for a TTL Index <a class="headerlink leafygreen-ui-1kepx47" href="#change-the-expireafterseconds-value-for-a-ttl-index" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="change-the-expireafterseconds-value-for-a-ttl-index"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To change the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> value for a TTL Index, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> database command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand({\n \"collMod\": &lt;collname&gt;,\n \"index\": {\n \"keyPattern\": &lt;keypattern&gt;,\n \"expireAfterSeconds\": &lt;number&gt;\n }\n})","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>({</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"collMod"</span>: &lt;collName&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"index"</span>: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keyPattern"</span>: &lt;keyPattern&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"expireAfterSeconds"</span>: &lt;number&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example changes the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> value for an index with the pattern <code class="leafygreen-ui-1l06pbn"> { "lastModifiedDate": 1 } </code> on the <code class="leafygreen-ui-1l06pbn"> tickets </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand({\n \"collMod\": \"tickets\",\n \"index\": {\n \"keyPattern\": { \"lastModifiedDate\": 1 },\n \"expireAfterSeconds\": 100\n }\n})","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>({</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"collMod"</span>: <span class="lg-highlight-string">"tickets"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"index"</span>: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keyPattern"</span>: { <span class="lg-highlight-string">"lastModifiedDate"</span>: <span class="lg-highlight-number">1</span> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"expireAfterSeconds"</span>: <span class="lg-highlight-number">100</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Consider the following before updating the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> parameter of a TTL index: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Changing the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> parameter <strong> does not </strong> trigger a complete index rebuild. However, reducing the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> value can make many documents eligible for immediate deletion, potentially causing performance issues due to the increased delete operations. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The recommended approach is to manually delete documents in small batches before updating the TTL index. This helps control the impact on your cluster. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Deleting many documents can fragment storage files, additionally impacting performance. You may need to run the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/compact/#std-label-compact"> compact </a> command on your collection or perform a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-sync/#std-label-replica-set-initial-sync"> Initial Sync </a> to reclaim space and optimize storage. </p> </li> </ul> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Expiration of Data <a class="headerlink leafygreen-ui-1kepx47" href="#expiration-of-data" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="expiration-of-data"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> TTL indexes expire documents after the specified number of seconds has passed since the indexed field value. The expiration threshold is the indexed field value plus the specified number of seconds. </p> <p class="leafygreen-ui-1kp3ins"> If the field is an array, and there are multiple date values in the index, MongoDB uses <em> lowest </em> (earliest) date value in the array to calculate the expiration threshold. </p> <p class="leafygreen-ui-1kp3ins"> For time series collections, TTL indexes also remove a bucket of data when all documents inside it expire. This is equal to the upper timestamp limit of the bucket, plus the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> value. For example, if a bucket covers data up until <code class="leafygreen-ui-1l06pbn"> 2023-03-27T18:29:59Z </code> and <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> is 300, the TTL index expires the bucket after <code class="leafygreen-ui-1l06pbn"> 2023-03-27T18:34:59Z </code> . </p> <p class="leafygreen-ui-1kp3ins"> If the indexed field in a document doesn't contain one or more date values, the document will not expire. </p> <p class="leafygreen-ui-1kp3ins"> If a document does not contain the indexed field, the document will not expire. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Delete Operations <a class="headerlink leafygreen-ui-1kepx47" href="#delete-operations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="delete-operations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> A background thread in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> reads the values in the index and removes expired <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-document"> documents </a> from the collection. </p> <p class="leafygreen-ui-1kp3ins"> In progress delete operations performed by the TTL thread appear in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.currentOp/#mongodb-method-db.currentOp"> <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> </a> output. As the TTL thread deletes documents, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.metrics.ttl.deletedDocuments"> <code class="leafygreen-ui-1l06pbn"> metrics.ttl.deletedDocuments </code> </a> server status metric is incremented. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 6.1: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To improve efficiency, MongoDB may batch multiple document deletions together. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/explain/#mongodb-dbcommand-dbcmd.explain"> <code class="leafygreen-ui-1l06pbn"> explain </code> </a> command <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/explain-results/#std-label-explain-results"> results </a> contain a new <code class="leafygreen-ui-1l06pbn"> BATCHED_DELETE </code> stage for batched document deletions. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If a time series collection contains documents with <code class="leafygreen-ui-1l06pbn"> timeField </code> timestamps before <code class="leafygreen-ui-1l06pbn"> 1970-01-01T00:00:00.000Z </code> or after <code class="leafygreen-ui-1l06pbn"> 2038-01-19T03:14:07.000Z </code> , no documents are deleted from the collection by the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-TTL"> TTL "time to live" </a> feature. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-ttl-monitor-deletion-process"> </span> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Deletion Process <a class="headerlink leafygreen-ui-1kepx47" href="#deletion-process" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="deletion-process"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> The TTL background deletion process checks each TTL index for expired documents. For each TTL index, the background process deletes documents until one of the following conditions is met: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The process deletes 50000 documents from the current index. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The process spends one second deleting documents from the current index. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> All expired documents are deleted from the current index. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Then, the process moves on to the next index. After the process goes through each TTL index once, the current sub-pass is complete and a new sub-pass begins to check for remaining expired documents. A pass is complete when the TTL monitor has deleted all possible candidate documents from all TTL indexes. </p> <p class="leafygreen-ui-1kp3ins"> Additionally, the process stops the current deletion loop every 60 seconds to prevent spending too much time on a single large delete. When this happens, the current sub-pass ends and a new sub-pass begins. </p> <p class="leafygreen-ui-1kp3ins"> Passes and sub-passes are tracked in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.metrics.ttl.passes"> <code class="leafygreen-ui-1l06pbn"> metrics.ttl.passes </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.metrics.ttl.subPasses"> <code class="leafygreen-ui-1l06pbn"> metrics.ttl.subPasses </code> </a> server status metrics, respectively. </p> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Timing of the Delete Operation <a class="headerlink leafygreen-ui-1kepx47" href="#timing-of-the-delete-operation" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="timing-of-the-delete-operation"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> MongoDB begins removing expired documents or time series buckets as soon as the index finishes building on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> . For more information on the index build process, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-creation/#std-label-index-operations"> Index Builds on Populated Collections. </a> </p> <p class="leafygreen-ui-1kp3ins"> The TTL index does not guarantee that expired data is deleted immediately upon expiration. There may be a delay between the time that a document expires and the time that MongoDB removes the document from the database. </p> <p class="leafygreen-ui-1kp3ins"> The background task that removes expired documents runs <em> every 60 seconds </em> . As a result, documents may remain in a collection during the period between the expiration of the document and the running of the background task. MongoDB starts deleting documents 0 to 60 seconds after the index completes. </p> <p class="leafygreen-ui-1kp3ins"> Because the duration of the removal operation depends on the workload of your <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance, expired data may exist for some time <em> beyond </em> the 60 second period between runs of the background task. </p> <p class="leafygreen-ui-1kp3ins"> The delete operations initiated by the TTL task run in the foreground, like other deletes. </p> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Replica Sets <a class="headerlink leafygreen-ui-1kepx47" href="#replica-sets" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="replica-sets"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> On <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> members, the TTL background thread <em> only </em> deletes documents when a member is in state <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> . The TTL background thread is idle when a member is in state <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondary </a> . <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> Secondary </a> members replicate deletion operations from the primary. </p> </section> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Support for Queries <a class="headerlink leafygreen-ui-1kepx47" href="#support-for-queries" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="support-for-queries"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> A TTL index supports queries in the same way non-TTL indexes do. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> mongod in Standalone Mode <a class="headerlink leafygreen-ui-1kepx47" href="#mongod-in-standalone-mode" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongod-in-standalone-mode"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The TTL monitor stops when <code class="leafygreen-ui-1l06pbn"> mongod </code> runs in standalone mode and the <code class="leafygreen-ui-1l06pbn"> system.local.replset </code> collection contains data. If you take a replica set node out of the replica set and run it as a standalone, then the TTL monitor is disabled. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Restrictions <a class="headerlink leafygreen-ui-1kepx47" href="#restrictions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="restrictions"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> TTL indexes are single-field indexes. <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-compound/#std-label-index-type-compound"> Compound indexes </a> do not support TTL and ignore the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> option. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> _id </code> field does not support TTL indexes. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 7.0, you can create a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-partial/#std-label-partial-ttl-indexes"> partial TTL index </a> on a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-manual-timeseries-landing"> time series collection </a> 's <code class="leafygreen-ui-1l06pbn"> metaField </code> . In earlier MongoDB versions, you can only create a TTL index for a time series collection's <code class="leafygreen-ui-1l06pbn"> timeField </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex"> <code class="leafygreen-ui-1l06pbn"> createIndex() </code> </a> to change the value of <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> of an existing index. Instead, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> database command. For details, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-change-ttl-expireafterseconds-value" target="_self"> <span> Change the <code class="leafygreen-ui-1l06pbn"> expireAfterSeconds </code> value for a TTL Index. </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If a non-TTL single-field index already exists for a field, you cannot create a TTL index on the same field because you cannot create indexes that have the same key specification and differ only by the options. To <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-convert-non-ttl-single-field-index-into-ttl" target="_self"> <span> change a non-TTL single-field index to a TTL index </span> </a> , use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> database command. </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/sort-results-with-indexes/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Use Indexes to Sort Query Results <a class="headerlink leafygreen-ui-1kepx47" href="#use-indexes-to-sort-query-results" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-indexes-to-sort-query-results"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#sort-with-a-single-field-index" target="_self"> <span> Sort with a Single Field Index </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#sort-on-multiple-fields" target="_self"> <span> Sort on Multiple Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#index-sort-order" target="_self"> <span> Index Sort Order </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#index-use-and-collation" target="_self"> <span> Index Use and Collation </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> Since indexes contain ordered records, MongoDB can obtain the results of a sort from an index that includes the sort fields. MongoDB <em> may </em> use multiple indexes to support a sort operation <em> if </em> the sort uses the same indexes as the query predicate. </p> <p class="leafygreen-ui-1kp3ins"> If MongoDB cannot use an index or indexes to obtain the sort order, MongoDB must perform a blocking sort operation on the data. A blocking sort indicates that MongoDB must consume and process all input documents to the sort before returning results. Blocking sorts do not block concurrent operations on the collection or database. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 6.0, if the server requires more than 100 megabytes of memory for a pipeline execution stage, MongoDB automatically writes temporary files to disk unless that query specifies <code class="leafygreen-ui-1l06pbn"> { allowDiskUse: false } </code> . If the server needs more than 100 megabytes of system memory for the blocking sort operation, MongoDB returns an error unless that query specifies <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.allowDiskUse/#mongodb-method-cursor.allowDiskUse"> <code class="leafygreen-ui-1l06pbn"> cursor.allowDiskUse() </code> </a> . For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.allowDiskUseByDefault"> <code class="leafygreen-ui-1l06pbn"> allowDiskUseByDefault </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Sort operations that use an index often have better performance than blocking sorts. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> When you sort based on an array field that is indexed with a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-multikey/#std-label-index-type-multikey"> multikey index </a> , the query plan includes a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-blocking-sort"> blocking sort </a> stage unless both of the following are true: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The index <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-multikey/multikey-index-bounds/#std-label-multikey-index-bounds-intersecting"> boundaries </a> for all sort fields are <code class="leafygreen-ui-1l06pbn"> [MinKey, MaxKey] </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> No boundaries for any multikey-indexed field have the same path prefix as the sort pattern. </p> </li> </ul> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-sort-results-single-field"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Sort with a Single Field Index <a class="headerlink leafygreen-ui-1kepx47" href="#sort-with-a-single-field-index" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sort-with-a-single-field-index"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If an ascending or a descending index is on a single field, the sort operation on the field can be in either direction. </p> <p class="leafygreen-ui-1kp3ins"> For example, create an ascending index on the field <code class="leafygreen-ui-1l06pbn"> a </code> for a collection <code class="leafygreen-ui-1l06pbn"> records </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.records.createIndex( { a: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">records</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">a</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This index can support an ascending sort on <code class="leafygreen-ui-1l06pbn"> a </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.records.find().sort( { a: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">records</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">a</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The index can also support the following descending sort on <code class="leafygreen-ui-1l06pbn"> a </code> by traversing the index in reverse order: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.records.find().sort( { a: -1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">records</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">a</span>: <!-- -->-<span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-sort-on-multiple-fields"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Sort on Multiple Fields <a class="headerlink leafygreen-ui-1kepx47" href="#sort-on-multiple-fields" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sort-on-multiple-fields"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Create a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-compound/#std-label-index-type-compound"> compound index </a> to support sorting on multiple fields. </p> <p class="leafygreen-ui-1kp3ins"> You can specify a sort on all the keys of the index or on a subset; however, the sort keys must be listed in the <em> same order </em> as they appear in the index. For example, an index key pattern <code class="leafygreen-ui-1l06pbn"> { a: 1, b: 1 } </code> can support a sort on <code class="leafygreen-ui-1l06pbn"> { a: 1, b: 1 } </code> but <em> not </em> on <code class="leafygreen-ui-1l06pbn"> { b: 1, a: 1 } </code> . </p> <p class="leafygreen-ui-1kp3ins"> For a query to use a compound index for a sort, the specified sort direction for all keys in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.sort/#mongodb-method-cursor.sort"> <code class="leafygreen-ui-1l06pbn"> cursor.sort() </code> </a> document must match the index key pattern <em> or </em> match the inverse of the index key pattern. For example, an index key pattern <code class="leafygreen-ui-1l06pbn"> { a: 1, b: -1 } </code> can support a sort on <code class="leafygreen-ui-1l06pbn"> { a: 1, b: -1 } </code> and <code class="leafygreen-ui-1l06pbn"> { a: -1, b: 1 } </code> but <strong> not </strong> on <code class="leafygreen-ui-1l06pbn"> { a: -1, b: -1 } </code> or <code class="leafygreen-ui-1l06pbn"> {a: 1, b: 1} </code> . </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-sort-index-prefix"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sort and Index Prefix <a class="headerlink leafygreen-ui-1kepx47" href="#sort-and-index-prefix" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sort-and-index-prefix"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If the sort keys correspond to the index keys or an index <em> prefix </em> , MongoDB can use the index to sort the query results. A <em> prefix </em> of a compound index is a subset that consists of one or more keys at the start of the index key pattern. </p> <p class="leafygreen-ui-1kp3ins"> For example, create a compound index on the <code class="leafygreen-ui-1l06pbn"> data </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.data.createIndex( { a:1, b: 1, c: 1, d: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">data</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">a</span>:<span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">b</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">c</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">d</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Then, the following are prefixes for that index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ a: 1 }\n{ a: 1, b: 1 }\n{ a: 1, b: 1, c: 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">a</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">a</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">b</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">a</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">b</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">c</span>: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following query and sort operations use the index prefixes to sort the results. These operations do not need to sort the result set in memory. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:75%"/> <col style="width:25%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Index Prefix </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> db.data.find().sort( { a: 1 } ) </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { a: 1 } </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> db.data.find().sort( { a: -1 } ) </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { a: 1 } </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> db.data.find().sort( { a: 1, b: 1 } ) </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { a: 1, b: 1 } </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> db.data.find().sort( { a: -1, b: -1 } ) </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { a: 1, b: 1 } </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> db.data.find().sort( { a: 1, b: 1, c: 1 } ) </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { a: 1, b: 1, c: 1 } </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> db.data.find( { a: { $gt: 4 } } ).sort( { a: 1, b: 1 } ) </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { a: 1, b: 1 } </code> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> Consider the following example in which the prefix keys of the index appear in both the query predicate and the sort: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.data.find( { a: { $gt: 4 } } ).sort( { a: 1, b: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">data</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">a</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">4</span> } } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">a</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">b</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In such cases, MongoDB can use the index to retrieve the documents in order specified by the sort. As the example shows, the index prefix in the query predicate can be different from the prefix in the sort. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-sort-index-nonprefix-subset"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sort and Non-prefix Subset of an Index <a class="headerlink leafygreen-ui-1kepx47" href="#sort-and-non-prefix-subset-of-an-index" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sort-and-non-prefix-subset-of-an-index"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> An index can support sort operations on a non-prefix subset of the index key pattern. To do so, the query must include <strong> equality </strong> conditions on all the prefix keys that precede the sort keys. </p> <p class="leafygreen-ui-1kp3ins"> For example, the collection <code class="leafygreen-ui-1l06pbn"> data </code> has the following index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ a: 1, b: 1, c: 1, d: 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">a</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">b</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">c</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">d</span>: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operations can use the index to get the sort order: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:75%"/> <col style="width:25%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Index Prefix </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> db.data.find( { a: 5 } ).sort( { b: 1, c: 1 } ) </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { a: 1 , b: 1, c: 1 } </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> db.data.find( { b: 3, a: 4 } ).sort( { c: 1 } ) </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { a: 1, b: 1, c: 1 } </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> db.data.find( { a: 5, b: { $lt: 3} } ).sort( { b: 1 } ) </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { a: 1, b: 1 } </code> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> As the last operation shows, only the index fields <em> preceding </em> the sort subset must have the equality conditions in the query document; the other index fields may specify other conditions. </p> <p class="leafygreen-ui-1kp3ins"> If the query does <strong> not </strong> specify an equality condition on an index prefix that precedes or overlaps with the sort specification, the operation will <strong> not </strong> efficiently use the index. For example, the following operations specify a sort document of <code class="leafygreen-ui-1l06pbn"> { c: 1 } </code> , but the query documents do not contain equality matches on the preceding index fields <code class="leafygreen-ui-1l06pbn"> a </code> and <code class="leafygreen-ui-1l06pbn"> b </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.data.find( { a: { $gt: 2 } } ).sort( { c: 1 } )\ndb.data.find( { c: 5 } ).sort( { c: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">data</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">a</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">2</span> } } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">c</span>: <span class="lg-highlight-number">1</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">data</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">c</span>: <span class="lg-highlight-number">5</span> } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">c</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> These operations <strong> will not </strong> efficiently use the index <code class="leafygreen-ui-1l06pbn"> { a: 1, b: 1, c: 1, d: 1 } </code> and may not even use the index to retrieve the documents. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Index Sort Order <a class="headerlink leafygreen-ui-1kepx47" href="#index-sort-order" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="index-sort-order"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A collection of indexed documents may have multiple data types in the key field. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When an index has a key with multiple data types, the index is sorted according to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-type-comparison-order/#std-label-bson-types-comparison-order"> BSON type sort order <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In array comparisons: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A less-than comparison, or an ascending sort, compares the smallest elements of the array according to the BSON type sort order. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A greater-than comparison, or a descending sort, compares the largest elements of the array according to the reverse BSON type sort order. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When comparing a field whose value is a one element array (example, <code class="leafygreen-ui-1l06pbn"> [ 1 ] </code> ) with non-array fields (example, <code class="leafygreen-ui-1l06pbn"> 2 </code> ), the comparison is for <code class="leafygreen-ui-1l06pbn"> 1 </code> and <code class="leafygreen-ui-1l06pbn"> 2 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A comparison of an empty array (example, <code class="leafygreen-ui-1l06pbn"> [ ] </code> ) considers the empty array as less than a <code class="leafygreen-ui-1l06pbn"> null </code> value or a missing field value. </p> </li> </ul> </li> </ul> <p class="leafygreen-ui-1kp3ins"> See the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-ex-sort-index-types" target="_self"> <span> index sorting example <!-- --> . </span> </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Index Use and Collation <a class="headerlink leafygreen-ui-1kepx47" href="#index-use-and-collation" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="index-use-and-collation"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To use an index for string comparisons, an operation must also specify the same collation. That is, an index with a collation cannot support an operation that performs string comparisons on the indexed fields if the operation specifies a different collation. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Because indexes that are configured with collation use ICU collation keys to achieve sort order, collation-aware index keys may be larger than index keys for indexes without collation. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For example, the collection <code class="leafygreen-ui-1l06pbn"> myColl </code> has an index on a string field <code class="leafygreen-ui-1l06pbn"> category </code> with the collation locale <code class="leafygreen-ui-1l06pbn"> "fr" </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.createIndex( { category: 1 }, { collation: { locale: \"fr\" } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-number">1</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following query operation, which specifies the same collation as the index, can use the index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { category: \"cafe\" } ).collation( { locale: \"fr\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> } ).<span class="lg-highlight-title lg-highlight-function">collation</span>( <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> However, the following query operation, which by default uses the "simple" binary collator, cannot use the index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { category: \"cafe\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For a compound index where the index prefix keys are not strings, arrays, and embedded documents, an operation that specifies a different collation can still use the index to support comparisons on the index prefix keys. </p> <p class="leafygreen-ui-1kp3ins"> For example, the collection <code class="leafygreen-ui-1l06pbn"> myColl </code> has a compound index on the numeric fields <code class="leafygreen-ui-1l06pbn"> score </code> and <code class="leafygreen-ui-1l06pbn"> price </code> and the string field <code class="leafygreen-ui-1l06pbn"> category </code> ; the index is created with the collation locale <code class="leafygreen-ui-1l06pbn"> "fr" </code> for string comparisons: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.createIndex(\n { score: 1, price: 1, category: 1 },\n { collation: { locale: \"fr\" } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operations, which use <code class="leafygreen-ui-1l06pbn"> "simple" </code> binary collation for string comparisons, can use the index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { score: 5 } ).sort( { price: 1 } )\ndb.myColl.find( { score: 5, price: { $gt: NumberDecimal( \"10\" ) } } ).sort( { price: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">5</span> } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">price</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>( <span class="lg-highlight-string">"10"</span> ) } } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation, which uses <code class="leafygreen-ui-1l06pbn"> "simple" </code> binary collation for string comparisons on the indexed <code class="leafygreen-ui-1l06pbn"> category </code> field, can use the index to fulfill only the <code class="leafygreen-ui-1l06pbn"> score: 5 </code> portion of the query: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { score: 5, category: \"cafe\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Matches against document keys, including embedded document keys, use simple binary comparison. This means that a query for a key like "foo.bár" will not match the key "foo.bar", regardless of the value you set for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation-parameter-strength"> strength </a> parameter. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <span class="leafygreen-ui-1qnjd6d" id="std-label-ex-sort-index-types"> </span> <p class="leafygreen-ui-1kp3ins"> The following example demonstrates sorting when index keys have the same or different types. </p> <p class="leafygreen-ui-1kp3ins"> Create the <code class="leafygreen-ui-1l06pbn"> keyTypes </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.keyTypes.insertMany( [\n { seqNum: 1, seqType: null, type: \"null\" },\n { seqNum: 29, seqType: null, type: \"null\" },\n { seqNum: 2, seqType: Int32(\"10\"), type: \"Int32\" },\n { seqNum: 28, seqType: Int32(\"10\"), type: \"Int32\" },\n { seqNum: 3, seqType: Long(\"10\"), type: \"Long\" },\n { seqNum: 27, seqType: Long(\"10\"), type: \"Long\" },\n { seqNum: 4, seqType: Decimal128(\"10\"), type: \"Decimal128\" },\n { seqNum: 26, seqType: Decimal128(\"10\"), type: \"Decimal128\" },\n { seqNum: 5, seqType: Double(\"10\"), type: \"Double\" },\n { seqNum: 25, seqType: Double(\"10\"), type: \"Double\" },\n { seqNum: 6, seqType: String(\"10\"), type: \"String\" },\n { seqNum: 24, seqType: String(\"10\"), type: \"String\" },\n { seqNum: 7, seqType: [ \"1\", \"2\", \"3\" ], type: \"Array\" },\n { seqNum: 23, seqType: [ \"1\", \"2\", \"3\" ], type: \"Array\" },\n { seqNum: 8, seqType: [ [1], [2], [3] ], type: \"Array\" },\n { seqNum: 22, seqType: [ [1], [2], [3] ], type: \"Array \" },\n { seqNum: 9, seqType: [ 1, 2, 3 ], type: \"Array\" },\n { seqNum: 21, seqType: [ 1, 2, 3 ], type: \"Array\" },\n { seqNum: 10, seqType: true, type: \"Boolean\" },\n { seqNum: 11, seqType: new Timestamp(), type: \"Timestamp\" },\n { seqNum: 12, seqType: new Date(), type: \"Date\" },\n { seqNum: 13, seqType: new ObjectId(), type: \"ObjectId\" },\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">keyTypes</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-literal">null</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"null"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">29</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-literal">null</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"null"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-title lg-highlight-class">Int32</span>(<span class="lg-highlight-string">"10"</span>)<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Int32"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">28</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-title lg-highlight-class">Int32</span>(<span class="lg-highlight-string">"10"</span>)<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Int32"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-title lg-highlight-class">Long</span>(<span class="lg-highlight-string">"10"</span>)<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Long"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">27</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-title lg-highlight-class">Long</span>(<span class="lg-highlight-string">"10"</span>)<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Long"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-title lg-highlight-class">Decimal128</span>(<span class="lg-highlight-string">"10"</span>)<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Decimal128"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">26</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-title lg-highlight-class">Decimal128</span>(<span class="lg-highlight-string">"10"</span>)<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Decimal128"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-title lg-highlight-class">Double</span>(<span class="lg-highlight-string">"10"</span>)<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Double"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">25</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-title lg-highlight-class">Double</span>(<span class="lg-highlight-string">"10"</span>)<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Double"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-title lg-highlight-class">String</span>(<span class="lg-highlight-string">"10"</span>)<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"String"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">24</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-title lg-highlight-class">String</span>(<span class="lg-highlight-string">"10"</span>)<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"String"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">7</span>, <span class="lg-highlight-attr">seqType</span>: <!-- -->[ <span class="lg-highlight-string">"1"</span>, <span class="lg-highlight-string">"2"</span>, <span class="lg-highlight-string">"3"</span> ]<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Array"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">23</span>, <span class="lg-highlight-attr">seqType</span>: <!-- -->[ <span class="lg-highlight-string">"1"</span>, <span class="lg-highlight-string">"2"</span>, <span class="lg-highlight-string">"3"</span> ]<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Array"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">8</span>, <span class="lg-highlight-attr">seqType</span>: <!-- -->[ <!-- -->[<span class="lg-highlight-number">1</span>]<!-- -->, <!-- -->[<span class="lg-highlight-number">2</span>]<!-- -->, <!-- -->[<span class="lg-highlight-number">3</span>] ]<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Array"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">22</span>, <span class="lg-highlight-attr">seqType</span>: <!-- -->[ <!-- -->[<span class="lg-highlight-number">1</span>]<!-- -->, <!-- -->[<span class="lg-highlight-number">2</span>]<!-- -->, <!-- -->[<span class="lg-highlight-number">3</span>] ]<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Array "</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">9</span>, <span class="lg-highlight-attr">seqType</span>: <!-- -->[ <span class="lg-highlight-number">1</span>, <span class="lg-highlight-number">2</span>, <span class="lg-highlight-number">3</span> ]<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Array"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">21</span>, <span class="lg-highlight-attr">seqType</span>: <!-- -->[ <span class="lg-highlight-number">1</span>, <span class="lg-highlight-number">2</span>, <span class="lg-highlight-number">3</span> ]<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Array"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">10</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-literal">true</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Boolean"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">11</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Timestamp</span>(<!-- -->)<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Timestamp"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<!-- -->)<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Date"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<!-- -->)<!-- -->, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"ObjectId"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Create indexes on the sequence number ( <code class="leafygreen-ui-1l06pbn"> seqNum </code> ) and sequence type ( <code class="leafygreen-ui-1l06pbn"> seqType </code> ) fields: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.keyTypes.createIndex( { seqNum: 1 } )\n\ndb.keyTypes.createIndex( { seqType: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">keyTypes</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">1</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">keyTypes</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Query the collection using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find() </code> </a> . The projection document, <code class="leafygreen-ui-1l06pbn"> { _id: 0 } </code> , suppresses the <code class="leafygreen-ui-1l06pbn"> _id </code> field in the output display. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.keyTypes.find( {}, { _id: 0 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">keyTypes</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{<!-- -->}<!-- -->, <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The documents are returned in insertion order: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ seqNum: 1, seqType: null, type: 'null' },\n{ seqNum: 29, seqType: null, type: 'null' },\n{ seqNum: 2, seqType: 10, type: 'Int32' },\n{ seqNum: 28, seqType: 10, type: 'Int32' },\n{ seqNum: 3, seqType: Long(\"10\"), type: 'Long' },\n{ seqNum: 27, seqType: Long(\"10\"), type: 'Long' },\n{ seqNum: 4, seqType: Decimal128(\"10\"), type: 'Decimal128' },\n\n// Output truncated"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 1, seqType: null, type: 'null' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 29, seqType: null, type: 'null' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 2, seqType: 10, type: 'Int32' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 28, seqType: 10, type: 'Int32' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 3, seqType: Long("10"), type: 'Long' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 27, seqType: Long("10"), type: 'Long' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 4, seqType: Decimal128("10"), type: 'Decimal128' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">// Output truncated</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The sequence number ( <code class="leafygreen-ui-1l06pbn"> seqNum </code> ) index has values of the same type. Use the <code class="leafygreen-ui-1l06pbn"> seqNum </code> index to query the <code class="leafygreen-ui-1l06pbn"> keyTypes </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.keyTypes.find( {}, { _id: 0 } ).sort( { seqNum: 1} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">keyTypes</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{<!-- -->}<!-- -->, <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span> } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">seqNum</span>: <span class="lg-highlight-number">1</span>} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> seqNum </code> keys are integers. The documents are returned in numerical order: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ seqNum: 1, seqType: null, type: 'null' },\n{ seqNum: 2, seqType: 10, type: 'Int32' },\n{ seqNum: 3, seqType: Long(\"10\"), type: 'Long' },\n{ seqNum: 4, seqType: Decimal128(\"10\"), type: 'Decimal128' },\n{ seqNum: 5, seqType: 10, type: 'Double' },\n{ seqNum: 6, seqType: '10', type: 'String' },\n{ seqNum: 7, seqType: [ '1', '2', '3' ], type: 'Array' },\n\n// Output truncated"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 1, seqType: null, type: 'null' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 2, seqType: 10, type: 'Int32' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 3, seqType: Long("10"), type: 'Long' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 4, seqType: Decimal128("10"), type: 'Decimal128' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 5, seqType: 10, type: 'Double' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 6, seqType: '10', type: 'String' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 7, seqType: [ '1', '2', '3' ], type: 'Array' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">// Output truncated</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The sequence type ( <code class="leafygreen-ui-1l06pbn"> seqType </code> ) index has values of the different types. Use the <code class="leafygreen-ui-1l06pbn"> seqType </code> index to query the <code class="leafygreen-ui-1l06pbn"> keyTypes </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.keyTypes.find( {}, { _id: 0 } ).sort( { seqType: 1} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">keyTypes</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{<!-- -->}<!-- -->, <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span> } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">seqType</span>: <span class="lg-highlight-number">1</span>} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The documents are returned in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-type-comparison-order/#std-label-bson-types-comparison-order"> BSON type sort order <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ seqNum: 1, seqType: null, type: 'null' },\n{ seqNum: 29, seqType: null, type: 'null' },\n{ seqNum: 9, seqType: [ 1, 2, 3 ], type: 'Array' },\n{ seqNum: 21, seqType: [ 1, 2, 3 ], type: 'Array' },\n{ seqNum: 2, seqType: 10, type: 'Int32' },\n{ seqNum: 28, seqType: 10, type: 'Int32' },\n{ seqNum: 3, seqType: Long(\"10\"), type: 'Long' },\n{ seqNum: 27, seqType: Long(\"10\"), type: 'Long' },\n{ seqNum: 4, seqType: Decimal128(\"10\"), type: 'Decimal128' },\n{ seqNum: 26, seqType: Decimal128(\"10\"), type: 'Decimal128' },\n{ seqNum: 5, seqType: 10, type: 'Double' },\n{ seqNum: 25, seqType: 10, type: 'Double' },\n{ seqNum: 7, seqType: [ '1', '2', '3' ], type: 'Array' },\n{ seqNum: 23, seqType: [ '1', '2', '3' ], type: 'Array' },\n{ seqNum: 6, seqType: '10', type: 'String' },\n{ seqNum: 24, seqType: '10', type: 'String' },\n{ seqNum: 8, seqType: [ [ 1 ], [ 2 ], [ 3 ] ], type: 'Array' },\n{ seqNum: 22, seqType: [ [ 1 ], [ 2 ], [ 3 ] ], type: 'Array ' },\n{\n seqNum: 13,\n seqType: ObjectId(\"6239e3922604d5a7478df071\"),\n type: 'ObjectId'\n},\n{ seqNum: 10, seqType: true, type: 'Boolean' },\n{\n seqNum: 12,\n seqType: ISODate(\"2022-03-22T14:56:18.100Z\"),\n type: 'Date'\n},\n{\n seqNum: 11,\n seqType: Timestamp({ t: 1647960978, i: 1 }),\n type: 'Timestamp'\n}"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 1, seqType: null, type: 'null' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 29, seqType: null, type: 'null' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 9, seqType: [ 1, 2, 3 ], type: 'Array' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 21, seqType: [ 1, 2, 3 ], type: 'Array' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 2, seqType: 10, type: 'Int32' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 28, seqType: 10, type: 'Int32' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 3, seqType: Long("10"), type: 'Long' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 27, seqType: Long("10"), type: 'Long' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 4, seqType: Decimal128("10"), type: 'Decimal128' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 26, seqType: Decimal128("10"), type: 'Decimal128' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 5, seqType: 10, type: 'Double' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 25, seqType: 10, type: 'Double' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 7, seqType: [ '1', '2', '3' ], type: 'Array' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 23, seqType: [ '1', '2', '3' ], type: 'Array' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 6, seqType: '10', type: 'String' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 24, seqType: '10', type: 'String' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 8, seqType: [ [ 1 ], [ 2 ], [ 3 ] ], type: 'Array' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 22, seqType: [ [ 1 ], [ 2 ], [ 3 ] ], type: 'Array ' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> seqNum: 13,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> seqType: ObjectId("6239e3922604d5a7478df071"),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> type: 'ObjectId'</td></tr><tr class=""><td class="leafygreen-ui-7razhx">},</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ seqNum: 10, seqType: true, type: 'Boolean' },</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> seqNum: 12,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> seqType: ISODate("2022-03-22T14:56:18.100Z"),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> type: 'Date'</td></tr><tr class=""><td class="leafygreen-ui-7razhx">},</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> seqNum: 11,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> seqType: Timestamp({ t: 1647960978, i: 1 }),</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> type: 'Timestamp'</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In array comparisons: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A less-than comparison, or an ascending sort, compares the smallest elements of the array according to the BSON type sort order. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A greater-than comparison, or a descending sort, compares the largest elements of the array according to the reverse BSON type sort order. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When comparing a field whose value is a one element array (example, <code class="leafygreen-ui-1l06pbn"> [ 1 ] </code> ) with non-array fields (example, <code class="leafygreen-ui-1l06pbn"> 2 </code> ), the comparison is for <code class="leafygreen-ui-1l06pbn"> 1 </code> and <code class="leafygreen-ui-1l06pbn"> 2 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A comparison of an empty array (example, <code class="leafygreen-ui-1l06pbn"> [ ] </code> ) considers the empty array as less than a <code class="leafygreen-ui-1l06pbn"> null </code> value or a missing field value. </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Numerical types (Int32, Long, Decimal128, Double) are equivalent when compared with other types. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Within the Numbers BSON type, numerical types are sorted: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Int32 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Long </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Decimal128 </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Double </p> </li> </ul> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/trunc/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $trunc (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-trunc--aggregation-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-trunc--aggregation-"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $trunc </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-trunc" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-expression-exp.-trunc"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-trunc" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $trunc </code> </span> </a> truncates a number to a whole integer <em> or </em> to a specified decimal place. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> $trunc </code> operator has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $trunc : [ &lt;number&gt;, &lt;place&gt; ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <!-- -->$trunc<!-- --> <!-- -->: <!-- -->[ &lt;<!-- -->number<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->place<!-- -->&gt; <!-- -->] }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> &lt;number&gt; </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> number </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a number. Specifically, the expression must resolve to an integer, double, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json-v1/#mongodb-bsontype-data_numberdecimal"> <code class="leafygreen-ui-1l06pbn"> decimal </code> </a> , or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json-v1/#mongodb-bsontype-data_numberlong"> <code class="leafygreen-ui-1l06pbn"> long </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-trunc" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $trunc </code> </span> </a> returns an error if the expression resolves to a non-numeric data type. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> &lt;place&gt; </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> <em> Optional </em> Can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to an integer between -20 and 100, exclusive. For example, <code class="leafygreen-ui-1l06pbn"> -20 &lt; place &lt; 100 </code> . Defaults to 0 if unspecified. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> &lt;place&gt; </code> resolves to a positive integer, <code class="leafygreen-ui-1l06pbn"> $trunc </code> truncates to <code class="leafygreen-ui-1l06pbn"> &lt;place&gt; </code> decimal places. </p> <p class="leafygreen-ui-1kp3ins"> For example, <code class="leafygreen-ui-1l06pbn"> $trunc : [1234.5678, 2] </code> truncates to two decimal places and returns <code class="leafygreen-ui-1l06pbn"> 1234.56 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> &lt;place&gt; </code> resolves to a negative integer, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-trunc" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $trunc </code> </span> </a> replaces <code class="leafygreen-ui-1l06pbn"> &lt;place&gt; </code> digits left of the decimal with <code class="leafygreen-ui-1l06pbn"> 0 </code> . </p> <p class="leafygreen-ui-1kp3ins"> For example, <code class="leafygreen-ui-1l06pbn"> $trunc : [1234.5678, -2] </code> replaces to two digits left of the decimal with <code class="leafygreen-ui-1l06pbn"> 0 </code> and returns <code class="leafygreen-ui-1l06pbn"> 1200 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the absolute value of <code class="leafygreen-ui-1l06pbn"> &lt;place&gt; </code> exceeds the number of digits to the left of the decimal, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-trunc" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $trunc </code> </span> </a> returns <code class="leafygreen-ui-1l06pbn"> 0 </code> . </p> <p class="leafygreen-ui-1kp3ins"> For example, <code class="leafygreen-ui-1l06pbn"> $trunc : [ 1234.5678, -5] </code> specifies the fifth digit left of the decimal. This exceeds the number of digits left of the decimal and returns <code class="leafygreen-ui-1l06pbn"> 0 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> &lt;place&gt; </code> resolves to <code class="leafygreen-ui-1l06pbn"> 0 </code> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-trunc" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $trunc </code> </span> </a> truncates all digits to the right of the decimal and returns the whole integer value. </p> <p class="leafygreen-ui-1kp3ins"> For example, <code class="leafygreen-ui-1l06pbn"> $trunc : [1234.5678, 0] </code> returns <code class="leafygreen-ui-1l06pbn"> 1234 </code> </p> </li> </ul> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> &lt;number&gt; </code> expression can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> as long as it resolves to a number. For more information on expressions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> Expression Operators <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-trunc" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $trunc </code> </span> </a> does not round the truncated data. To round input values to a specified place, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/round/#mongodb-expression-exp.-round"> <code class="leafygreen-ui-1l06pbn"> $round </code> </a> expression. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Returned Data Type <a class="headerlink leafygreen-ui-1kepx47" href="#returned-data-type" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="returned-data-type"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The returned data type matches the data type of the input expression or value. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> null </code> , <code class="leafygreen-ui-1l06pbn"> NaN </code> , and <code class="leafygreen-ui-1l06pbn"> +/- Infinity </code> <a class="headerlink leafygreen-ui-1kepx47" href="#null--nan--and-----infinity" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="null--nan--and-----infinity"> </div> </a> </h3> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the argument resolves to a value of <code class="leafygreen-ui-1l06pbn"> null </code> or refers to a field that is missing, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-trunc" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $trunc </code> </span> </a> returns <code class="leafygreen-ui-1l06pbn"> null </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the argument resolves to <code class="leafygreen-ui-1l06pbn"> NaN </code> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-trunc" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $trunc </code> </span> </a> returns <code class="leafygreen-ui-1l06pbn"> NaN </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the argument resolves to negative or positive infinity, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-trunc" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $trunc </code> </span> </a> returns negative or positive infinity respectively. </p> </li> </ul> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:85%"/> <col style="width:15%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Results </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $trunc: [ NaN, 1] } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> NaN </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $trunc: [ null, 1] } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> null </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $trunc : [ Infinity, 1 ] } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> Infinity </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $trunc : [ -Infinity, 1 ] } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> -Infinity </code> </div> </div> </td> </tr> </tbody> </table> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Create a collection named <code class="leafygreen-ui-1l06pbn"> samples </code> with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.samples.insertMany(\n [\n { _id: 1, value: 19.25 },\n { _id: 2, value: 28.73 },\n { _id: 3, value: 34.32 },\n { _id: 4, value: -45.34 }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">samples</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">value</span>: <span class="lg-highlight-number">19.25</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">value</span>: <span class="lg-highlight-number">28.73</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">value</span>: <span class="lg-highlight-number">34.32</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">value</span>: <!-- -->-<span class="lg-highlight-number">45.34</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The following aggregation returns <code class="leafygreen-ui-1l06pbn"> value </code> truncated to the first decimal place: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.samples.aggregate([\n { $project: { truncatedValue: { $trunc: [ \"$value\", 1 ] } } }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">samples</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$project</span>: <!-- -->{ <span class="lg-highlight-attr">truncatedValue</span>: <!-- -->{ <span class="lg-highlight-attr">$trunc</span>: <!-- -->[ <span class="lg-highlight-string">"$value"</span>, <span class="lg-highlight-number">1</span> ] } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"truncatedValue\" : 19.2 }\n{ \"_id\" : 2, \"truncatedValue\" : 28.7 }\n{ \"_id\" : 3, \"truncatedValue\" : 34.3 }\n{ \"_id\" : 4, \"truncatedValue\" : -45.3 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"truncatedValue"</span> <!-- -->: <span class="lg-highlight-number">19.2</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"truncatedValue"</span> <!-- -->: <span class="lg-highlight-number">28.7</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"truncatedValue"</span> <!-- -->: <span class="lg-highlight-number">34.3</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"truncatedValue"</span> <!-- -->: <!-- -->-<span class="lg-highlight-number">45.3</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The following aggregation returns <code class="leafygreen-ui-1l06pbn"> value </code> truncated to the first place: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.samples.aggregate([\n { $project: { truncatedValue: { $trunc: [ \"$value\", -1 ] } } }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">samples</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$project</span>: <!-- -->{ <span class="lg-highlight-attr">truncatedValue</span>: <!-- -->{ <span class="lg-highlight-attr">$trunc</span>: <!-- -->[ <span class="lg-highlight-string">"$value"</span>, <!-- -->-<span class="lg-highlight-number">1</span> ] } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"truncatedValue\" : 10 }\n{ \"_id\" : 2, \"truncatedValue\" : 20 }\n{ \"_id\" : 3, \"truncatedValue\" : 30 }\n{ \"_id\" : 4, \"truncatedValue\" : -40 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"truncatedValue"</span> <!-- -->: <span class="lg-highlight-number">10</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"truncatedValue"</span> <!-- -->: <span class="lg-highlight-number">20</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"truncatedValue"</span> <!-- -->: <span class="lg-highlight-number">30</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"truncatedValue"</span> <!-- -->: <!-- -->-<span class="lg-highlight-number">40</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The following aggregation returns``value`` truncated to the whole integer: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.samples.aggregate([\n { $project: { truncatedValue: { $trunc: [ \"$value\", 0 ] } } }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">samples</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$project</span>: <!-- -->{ <span class="lg-highlight-attr">truncatedValue</span>: <!-- -->{ <span class="lg-highlight-attr">$trunc</span>: <!-- -->[ <span class="lg-highlight-string">"$value"</span>, <span class="lg-highlight-number">0</span> ] } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"truncatedValue\" : 19 }\n{ \"_id\" : 2, \"truncatedValue\" : 28 }\n{ \"_id\" : 3, \"truncatedValue\" : 34 }\n{ \"_id\" : 4, \"truncatedValue\" : -45 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"truncatedValue"</span> <!-- -->: <span class="lg-highlight-number">19</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"truncatedValue"</span> <!-- -->: <span class="lg-highlight-number">28</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"truncatedValue"</span> <!-- -->: <span class="lg-highlight-number">34</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"truncatedValue"</span> <!-- -->: <!-- -->-<span class="lg-highlight-number">45</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/update/each/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $each <a class="headerlink leafygreen-ui-1kepx47" href="#-each" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-each"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="update"> <dt> <code class="leafygreen-ui-1l06pbn"> $each </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-update-up.-each" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-update-up.-each"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-each" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $each </code> </span> </a> modifier is available for use with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/addToSet/#mongodb-update-up.-addToSet"> <code class="leafygreen-ui-1l06pbn"> $addToSet </code> </a> operator and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#mongodb-update-up.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> operator. </p> <p class="leafygreen-ui-1kp3ins"> Use with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/addToSet/#mongodb-update-up.-addToSet"> <code class="leafygreen-ui-1l06pbn"> $addToSet </code> </a> operator to add multiple values to an array <code class="leafygreen-ui-1l06pbn"> &lt;field&gt; </code> if the values do not exist in the <code class="leafygreen-ui-1l06pbn"> &lt;field&gt; </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $addToSet: { &lt;field&gt;: { $each: [ &lt;value1&gt;, &lt;value2&gt; ... ] } } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$addToSet</span>: <!-- -->{ &lt;<!-- -->field<!-- -->&gt;<!-- -->: <!-- -->{ <span class="lg-highlight-attr">$each</span>: <!-- -->[ &lt;<!-- -->value1<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->value2<!-- -->&gt; <!-- -->...<!-- --> ] } } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Use with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#mongodb-update-up.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> operator to append multiple values to an array <code class="leafygreen-ui-1l06pbn"> &lt;field&gt; </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $push: { &lt;field&gt;: { $each: [ &lt;value1&gt;, &lt;value2&gt; ... ] } } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$push</span>: <!-- -->{ &lt;<!-- -->field<!-- -->&gt;<!-- -->: <!-- -->{ <span class="lg-highlight-attr">$each</span>: <!-- -->[ &lt;<!-- -->value1<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->value2<!-- -->&gt; <!-- -->...<!-- --> ] } } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#mongodb-update-up.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> operator can use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-each" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $each </code> </span> </a> modifier with other modifiers. For a list of modifiers available for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#mongodb-update-up.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#std-label-push-modifiers"> Modifiers <!-- --> . </a> </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, update operators process document fields with string-based names in lexicographic order. Fields with numeric names are processed in numeric order. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-processing-order"> Update Operators Behavior </a> for details. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use <code class="leafygreen-ui-1l06pbn"> $each </code> with <code class="leafygreen-ui-1l06pbn"> $push </code> Operator <a class="headerlink leafygreen-ui-1kepx47" href="#use--each--with--push-operator" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use--each--with--push-operator"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example appends each element of <code class="leafygreen-ui-1l06pbn"> [ 90, 92, 85 ] </code> to the <code class="leafygreen-ui-1l06pbn"> scores </code> array for the document where the <code class="leafygreen-ui-1l06pbn"> name </code> field equals <code class="leafygreen-ui-1l06pbn"> joe </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.updateOne(\n { name: \"joe\" },\n { $push: { scores: { $each: [ 90, 92, 85 ] } } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">"joe"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$push</span>: <!-- -->{ <span class="lg-highlight-attr">scores</span>: <!-- -->{ <span class="lg-highlight-attr">$each</span>: <!-- -->[ <span class="lg-highlight-number">90</span>, <span class="lg-highlight-number">92</span>, <span class="lg-highlight-number">85</span> ] } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use <code class="leafygreen-ui-1l06pbn"> $each </code> with <code class="leafygreen-ui-1l06pbn"> $addToSet </code> Operator <a class="headerlink leafygreen-ui-1kepx47" href="#use--each--with--addtoset-operator" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use--each--with--addtoset-operator"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> A collection <code class="leafygreen-ui-1l06pbn"> inventory </code> has the following document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ _id: 2, item: \"cable\", tags: [ \"electronics\", \"supplies\" ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"cable"</span>, <span class="lg-highlight-attr">tags</span>: <!-- -->[ <span class="lg-highlight-string">"electronics"</span>, <span class="lg-highlight-string">"supplies"</span> ] }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Then the following operation uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/addToSet/#mongodb-update-up.-addToSet"> <code class="leafygreen-ui-1l06pbn"> $addToSet </code> </a> operator with the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-each" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $each </code> </span> </a> modifier to add multiple elements to the <code class="leafygreen-ui-1l06pbn"> tags </code> array: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.updateOne(\n { _id: 2 },\n { $addToSet: { tags: { $each: [ \"camera\", \"electronics\", \"accessories\" ] } } }\n )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$addToSet</span>: <!-- -->{ <span class="lg-highlight-attr">tags</span>: <!-- -->{ <span class="lg-highlight-attr">$each</span>: <!-- -->[ <span class="lg-highlight-string">"camera"</span>, <span class="lg-highlight-string">"electronics"</span>, <span class="lg-highlight-string">"accessories"</span> ] } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation only adds <code class="leafygreen-ui-1l06pbn"> "camera" </code> and <code class="leafygreen-ui-1l06pbn"> "accessories" </code> to the <code class="leafygreen-ui-1l06pbn"> tags </code> array. <code class="leafygreen-ui-1l06pbn"> "electronics" </code> was already in the array: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: 2,\n item: \"cable\",\n tags: [ \"electronics\", \"supplies\", \"camera\", \"accessories\" ]\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"cable"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">tags</span>: <!-- -->[ <span class="lg-highlight-string">"electronics"</span>, <span class="lg-highlight-string">"supplies"</span>, <span class="lg-highlight-string">"camera"</span>, <span class="lg-highlight-string">"accessories"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/sp.processor.sample/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> sp.processor.sample() <a class="headerlink leafygreen-ui-1kepx47" href="#sp.processor.sample--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sp.processor.sample--"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#command-fields" target="_self"> <span> Command Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#access-control" target="_self"> <span> Access Control </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self"> <span> Learn More </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> sp.processor.sample() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-sp.processor.sample" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-sp.processor.sample"> </div> </a> </dt> <dd> </dd> </dl> <div> <p> <em> New <!-- --> in version <!-- --> 7.0 </em> : <!-- --> Returns arrays of sampled results from a currently running <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-sp/overview/#mongodb-expression-exp.Stream-Processor" target="_self"> <span> Stream Processor </span> </a> on the current <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-sp/overview/#mongodb-expression-exp.Stream-Processing-Instance" target="_self"> <span> Stream Processing Instance <!-- --> . </span> </a> </p> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-sp.processor.sample" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> sp.processor.sample() </code> </span> </a> method has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sp.processor.sample()","programmingLanguage":"JSON"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sp.processor.sample()</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Command Fields <a class="headerlink leafygreen-ui-1kepx47" href="#command-fields" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="command-fields"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sp.processor.sample() </code> takes no fields. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sp.processor.sample() </code> returns arrays of sampled results from the named, currently running stream processor to <code class="leafygreen-ui-1l06pbn"> STDOUT </code> . This command runs continuously until you cancel it using <code class="leafygreen-ui-1l06pbn"> CTRL-C </code> , or until the returned samples cumulatively reach <code class="leafygreen-ui-1l06pbn"> 40 MB </code> . </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Access Control <a class="headerlink leafygreen-ui-1kepx47" href="#access-control" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="access-control"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The user running <code class="leafygreen-ui-1l06pbn"> sp.processor.sample() </code> must have the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/mongodb-users-roles-and-privileges/#mongodb-atlasrole-atlasAdmin" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> atlasAdmin </code> </span> </a> role. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example shows an expected response from calling <code class="leafygreen-ui-1l06pbn"> sp.solarDemo.sample() </code> to sample from a stream processor called <code class="leafygreen-ui-1l06pbn"> solarDemo </code> : </p> <div class="css-1f5771r"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sp.solarDemo.sample()","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sp.solarDemo.sample()</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="css-9st569 efa38qy0" style="--border-color:#E8EDEB"> <button aria-disabled="false" class="lg-ui-button-0000 leafygreen-ui-hix6y6" data-lgid="lg-button" role="button" type="button"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg alt="" aria-hidden="true" class="leafygreen-ui-hjnzs9" fill="none" height="16" role="presentation" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M14.364 10.778a1 1 0 0 0 0-1.414l-4.95-4.95-.707-.707a1 1 0 0 0-1.414 0l-.707.707-4.95 4.95a1 1 0 0 0 0 1.414l.707.707a1 1 0 0 0 1.414 0L8 7.243l4.243 4.242a1 1 0 0 0 1.414 0l.707-.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> HIDE OUTPUT </div> </button> </div> <div class="leafygreen-ui-1oteowz"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: {\n device_id: 'device_5'\n },\n max_temp: 8,\n max_watts: 66,\n min_watts: 66,\n avg_watts: 66,\n median_watts: 66,\n _stream_meta: {\n window: {\n start: ISODate('2024-03-19T22:09:10.000Z'),\n end: ISODate('2024-03-19T22:09:20.000Z')\n }\n }\n}\n{\n _id: {\n device_id: 'device_0'\n },\n max_temp: 18,\n max_watts: 210,\n min_watts: 68,\n avg_watts: 157,\n median_watts: 193,\n _stream_meta: {\n window: {\n start: ISODate('2024-03-19T22:09:10.000Z'),\n end: ISODate('2024-03-19T22:09:20.000Z')\n }\n }\n}\n{\n _id: {\n device_id: 'device_10'\n },\n max_temp: 21,\n max_watts: 128,\n min_watts: 4,\n avg_watts: 66,\n median_watts: 4,\n _stream_meta: {\n window: {\n start: ISODate('2024-03-19T22:09:10.000Z'),\n end: ISODate('2024-03-19T22:09:20.000Z')\n }\n }\n}\n{\n _id: {\n device_id: 'device_9'\n },\n max_temp: 10,\n max_watts: 227,\n min_watts: 66,\n avg_watts: 131.4,\n median_watts: 108,\n _stream_meta: {\n window: {\n start: ISODate('2024-03-19T22:09:10.000Z'),\n end: ISODate('2024-03-19T22:09:20.000Z')\n }\n }\n}","programmingLanguage":"JSON"} </script> <div class="css-1sax7hu e11q6jfk0" style="--code-container-border:initial;--code-pre-border:none"> <div class="leafygreen-ui-1fyvhqe"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-12cejcz" tabindex="-1"><code class="lg-highlight-hljs-dark json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> _id<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> device_id<span class="lg-highlight-punctuation">:</span> 'device_5'</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> max_temp<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">8</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> max_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">66</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> min_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">66</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> avg_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">66</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> median_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">66</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> _stream_meta<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> window<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> start<span class="lg-highlight-punctuation">:</span> ISODate('<span class="lg-highlight-number">2024</span><span class="lg-highlight-number">-03</span><span class="lg-highlight-number">-19</span>T22<span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">09</span><span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">10.000</span>Z')<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> end<span class="lg-highlight-punctuation">:</span> ISODate('<span class="lg-highlight-number">2024</span><span class="lg-highlight-number">-03</span><span class="lg-highlight-number">-19</span>T22<span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">09</span><span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">20.000</span>Z')</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> _id<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> device_id<span class="lg-highlight-punctuation">:</span> 'device_0'</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> max_temp<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">18</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> max_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">210</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> min_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">68</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> avg_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">157</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> median_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">193</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> _stream_meta<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> window<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> start<span class="lg-highlight-punctuation">:</span> ISODate('<span class="lg-highlight-number">2024</span><span class="lg-highlight-number">-03</span><span class="lg-highlight-number">-19</span>T22<span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">09</span><span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">10.000</span>Z')<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> end<span class="lg-highlight-punctuation">:</span> ISODate('<span class="lg-highlight-number">2024</span><span class="lg-highlight-number">-03</span><span class="lg-highlight-number">-19</span>T22<span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">09</span><span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">20.000</span>Z')</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> _id<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> device_id<span class="lg-highlight-punctuation">:</span> 'device_10'</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> max_temp<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">21</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> max_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">128</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> min_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">4</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> avg_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">66</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> median_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">4</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> _stream_meta<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> window<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> start<span class="lg-highlight-punctuation">:</span> ISODate('<span class="lg-highlight-number">2024</span><span class="lg-highlight-number">-03</span><span class="lg-highlight-number">-19</span>T22<span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">09</span><span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">10.000</span>Z')<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> end<span class="lg-highlight-punctuation">:</span> ISODate('<span class="lg-highlight-number">2024</span><span class="lg-highlight-number">-03</span><span class="lg-highlight-number">-19</span>T22<span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">09</span><span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">20.000</span>Z')</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> _id<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> device_id<span class="lg-highlight-punctuation">:</span> 'device_9'</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> max_temp<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">10</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> max_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">227</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> min_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">66</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> avg_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">131.4</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> median_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">108</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> _stream_meta<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> window<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> start<span class="lg-highlight-punctuation">:</span> ISODate('<span class="lg-highlight-number">2024</span><span class="lg-highlight-number">-03</span><span class="lg-highlight-number">-19</span>T22<span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">09</span><span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">10.000</span>Z')<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> end<span class="lg-highlight-punctuation">:</span> ISODate('<span class="lg-highlight-number">2024</span><span class="lg-highlight-number">-03</span><span class="lg-highlight-number">-19</span>T22<span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">09</span><span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">20.000</span>Z')</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</span></td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-sp/manage-stream-processor/" target="_self"> <span> Manage Stream Processors </span> </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/resync-replica-set-member/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Resync a Member of a Self-Managed Replica Set <a class="headerlink leafygreen-ui-1kepx47" href="#resync-a-member-of-a-self-managed-replica-set" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="resync-a-member-of-a-self-managed-replica-set"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#procedures" target="_self"> <span> Procedures </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> A replica set member becomes "stale" when its replication process falls so far behind that the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> overwrites oplog entries the member has not yet replicated. The member cannot catch up and becomes "stale." When this occurs, you must completely resynchronize the member by removing its data and performing an <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-sync/#std-label-replica-set-initial-sync"> initial sync <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> This tutorial addresses both resyncing a stale member and creating a new member using seed data from another member, both of which can be used to restore a replica set member. When syncing a member, choose a time when the system has the bandwidth to move a large amount of data. Schedule the synchronization during a time of low usage or during a maintenance window. </p> <p class="leafygreen-ui-1kp3ins"> MongoDB provides two options for performing an initial sync: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Restart the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> with an empty data directory and let MongoDB's normal initial syncing feature restore the data. This is the more simple option but may take longer to replace the data. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-replica-set-auto-resync-stale-member" target="_self"> <span> Automatically Sync a Member <!-- --> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Restart the machine with a copy of a recent data directory from another member in the replica set. This procedure can replace the data more quickly but requires more manual steps. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-replica-set-resync-by-copying" target="_self"> <span> Sync by Copying Data Files from Another Member <!-- --> . </span> </a> </p> </li> </ul> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedures <a class="headerlink leafygreen-ui-1kepx47" href="#procedures" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="procedures"> </div> </a> </h2> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To prevent changing the write quorum, never rotate more than one replica set member at a time. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-replica-set-auto-resync-stale-member"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Automatically Sync a Member <a class="headerlink leafygreen-ui-1kepx47" href="#automatically-sync-a-member" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="automatically-sync-a-member"> </div> </a> </h3> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> During initial sync, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> removes the contents of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> dbPath </code> </a> directory. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> This procedure relies on MongoDB's regular process for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-sync/#std-label-replica-set-sync"> Replica Set Syncing </a> . This stores the current data on the member. For an overview of MongoDB initial sync process, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-sync/#std-label-replica-set-sync"> Replica Set Syncing </a> section. </p> <p class="leafygreen-ui-1kp3ins"> Initial sync operations can impact the other members of the set and create additional traffic to the primary. The syncing member requires another member of the set that is accessible and up to date. </p> <p class="leafygreen-ui-1kp3ins"> If the instance has no data, you can follow the <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/expand-replica-set/#std-label-server-replica-set-deploy-expand"> Add Members to a Self-Managed Replica Set </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/replace-replica-set-member/#std-label-server-replica-set-replace-member"> Replace a Self-Managed Replica Set Member </a> procedure to add a new member to a replica set. </p> <p class="leafygreen-ui-1kp3ins"> You can also force a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> that is already a member of the set to perform an initial sync by restarting the instance without the contents of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> dbPath </code> </a> directory: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Stop the member's <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance. To ensure a clean shutdown, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.shutdownServer/#mongodb-method-db.shutdownServer"> <code class="leafygreen-ui-1l06pbn"> db.shutdownServer() </code> </a> method from <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> or on Linux systems, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--shutdown"> <code class="leafygreen-ui-1l06pbn"> mongod --shutdown </code> </a> option. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> (Optional) Make a backup of all data and sub-directories from the member's <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> dbPath </code> </a> directory. If a full backup is not required, consider backing up just the <code class="leafygreen-ui-1l06pbn"> diagnostic.data </code> directory to preserve potentially-useful troubleshooting data in the event of an issue. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/full-time-diagnostic-data-capture/#std-label-ftdc-stub"> Full Time Diagnostic Data Capture </a> for more information. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Delete all data and sub-directories from the member's <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> dbPath </code> </a> directory. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-mongodb-processes/#std-label-manage-mongodb-processes"> Restart the mongod process <!-- --> . </a> </p> </li> </ol> <p class="leafygreen-ui-1kp3ins"> At this point, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> performs an initial sync. The length of the initial sync process depends on the size of the database and the network latency between members of the replica set. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-replica-set-resync-by-copying"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sync by Copying Data Files from Another Member <a class="headerlink leafygreen-ui-1kepx47" href="#sync-by-copying-data-files-from-another-member" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sync-by-copying-data-files-from-another-member"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> This approach "seeds" a new or stale member using the data files from an existing member of the replica set. The data files <strong> must </strong> be sufficiently recent to allow the new member to catch up with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> . Otherwise the member would need to perform an initial sync. </p> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Copy the Data Files <a class="headerlink leafygreen-ui-1kepx47" href="#copy-the-data-files" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="copy-the-data-files"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> You can capture the data files as either a snapshot or a direct copy. However, in most cases you cannot copy data files from a running <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance to another because the data files will change during the file copy operation. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If copying data files, ensure that your copy includes the content of the <code class="leafygreen-ui-1l06pbn"> local </code> database. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> You <em> cannot </em> use a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongodump/#mongodb-binary-bin.mongodump" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongodump </code> </span> </a> backup for the data files: <strong> only a snapshot backup </strong> . For approaches to capturing a consistent snapshot of a running <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/backups/#std-label-backup-methods"> Backup Methods for a Self-Managed Deployment </a> documentation. </p> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Sync the Member <a class="headerlink leafygreen-ui-1kepx47" href="#sync-the-member" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sync-the-member"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> After you have copied the data files from the "seed" source, start the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance with a new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-._id"> <code class="leafygreen-ui-1l06pbn"> members[n]._id </code> </a> and allow it to apply all operations from the oplog until it reflects the current state of the replica set. To see the current status of the replica set, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.printSecondaryReplicationInfo/#mongodb-method-rs.printSecondaryReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> rs.printSecondaryReplicationInfo() </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> . </a> </p> </section> </section> </section> </section>
https://www.mongodb.com/docs/manual/core/timeseries/timeseries-limitations/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Time Series Collection Limitations <a class="headerlink leafygreen-ui-1kepx47" href="#time-series-collection-limitations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="time-series-collection-limitations"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#unsupported-features" target="_self"> <span> Unsupported Features </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#aggregation--merge" target="_self"> <span> Aggregation $merge </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#distinct-command" target="_self"> <span> distinct Command </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#geospatial-queries" target="_self"> <span> Geospatial Queries </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#document-size" target="_self"> <span> Document Size </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#extended-date-range" target="_self"> <span> Extended Date Range </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#updates" target="_self"> <span> Updates </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#time-series-secondary-indexes" target="_self"> <span> Time Series Secondary Indexes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#capped-collections" target="_self"> <span> Capped Collections </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#modification-of-collection-type" target="_self"> <span> Modification of Collection Type </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#modification-of-timefield-and-metafield" target="_self"> <span> Modification of <code class="css-1kekw28 e1wawog0"> timeField </code> and <code class="css-1kekw28 e1wawog0"> metaField </code> </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#granularity" target="_self"> <span> Granularity </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#bucket-size" target="_self"> <span> Bucket Size </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#modifying-bucket-parameters" target="_self"> <span> Modifying Bucket Parameters </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#sharding" target="_self"> <span> Sharding </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#sharding-administration-commands" target="_self"> <span> Sharding Administration Commands </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#shard-key-fields" target="_self"> <span> Shard Key Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#resharding" target="_self"> <span> Resharding </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#transactions" target="_self"> <span> Transactions </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#views" target="_self"> <span> Views </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#snapshot-isolation" target="_self"> <span> Snapshot Isolation </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-manual-timeseries-collection"> Time series collections </a> generally behave like regular collections with several limitations. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Unsupported Features <a class="headerlink leafygreen-ui-1kepx47" href="#unsupported-features" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="unsupported-features"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> MongoDB does not support the following features with time series collections: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/" target="_self"> <span> Atlas Search </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/changeStreams/#std-label-changeStreams"> Change streams </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/#std-label-manual-csfle-feature"> Client-Side Field Level Encryption </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/app-services/triggers/database-triggers/" target="_self"> <span> Database Triggers </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/app-services/graphql/" target="_self"> <span> GraphQL API (deprecated) </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/schema-validation/#std-label-schema-validation-overview"> Schema validation rules </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/reIndex/#mongodb-dbcommand-dbcmd.reIndex"> <code class="leafygreen-ui-1l06pbn"> reIndex </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/renameCollection/#mongodb-dbcommand-dbcmd.renameCollection"> <code class="leafygreen-ui-1l06pbn"> renameCollection </code> </a> </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Aggregation $merge <a class="headerlink leafygreen-ui-1kepx47" href="#aggregation--merge" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="aggregation--merge"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You cannot use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/merge/#mongodb-pipeline-pipe.-merge"> <code class="leafygreen-ui-1l06pbn"> $merge </code> </a> aggregation stage to add data from another collection to a time series collection. Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/out/#mongodb-pipeline-pipe.-out"> <code class="leafygreen-ui-1l06pbn"> $out </code> </a> aggregation stage to write documents to a time series collection. </p> <p class="leafygreen-ui-1kp3ins"> You can use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/merge/#mongodb-pipeline-pipe.-merge"> <code class="leafygreen-ui-1l06pbn"> $merge </code> </a> to move data from a time series collection to another collection. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-timeseries-limitation-distinct"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> distinct Command <a class="headerlink leafygreen-ui-1kepx47" href="#distinct-command" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="distinct-command"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Due to the unique data structure of time series collections, MongoDB can't efficiently index them for distinct values. Avoid using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/distinct/#mongodb-dbcommand-dbcmd.distinct"> <code class="leafygreen-ui-1l06pbn"> distinct </code> </a> command or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.distinct/#mongodb-method-db.collection.distinct"> <code class="leafygreen-ui-1l06pbn"> db.collection.distinct() </code> </a> helper method on time series collections. Instead, use a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> aggregation to group documents by distinct values. </p> <p class="leafygreen-ui-1kp3ins"> For example, to query for distinct <code class="leafygreen-ui-1l06pbn"> meta.type </code> values on documents where <code class="leafygreen-ui-1l06pbn"> meta.project = 10 </code> , instead of: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.foo.distinct(\"meta.type\", {\"meta.project\": 10})","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">foo</span>.<span class="lg-highlight-title lg-highlight-function">distinct</span>(<span class="lg-highlight-string">"meta.type"</span>, <!-- -->{<span class="lg-highlight-string">"meta.project"</span>: <span class="lg-highlight-number">10</span>})</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Use: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.foo.createIndex({\"meta.project\":1, \"meta.type\":1})\ndb.foo.aggregate([{$match: {\"meta.project\": 10}},\n {$group: {_id: \"$meta.type\"}}])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">foo</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>(<!-- -->{<span class="lg-highlight-string">"meta.project"</span>:<span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"meta.type"</span>:<span class="lg-highlight-number">1</span>})</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">foo</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(<!-- -->[<!-- -->{<span class="lg-highlight-attr">$match</span>: <!-- -->{<span class="lg-highlight-string">"meta.project"</span>: <span class="lg-highlight-number">10</span>}}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{<span class="lg-highlight-attr">$group</span>: <!-- -->{<span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"$meta.type"</span>}}])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This works as follows: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Creating a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-compound/#std-label-index-type-compound"> compound index </a> on <code class="leafygreen-ui-1l06pbn"> meta.project </code> and <code class="leafygreen-ui-1l06pbn"> meta.type </code> and supports the aggregation. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/match/#mongodb-pipeline-pipe.-match"> <code class="leafygreen-ui-1l06pbn"> $match </code> </a> stage filters for documents where <code class="leafygreen-ui-1l06pbn"> meta.project = 10 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> stage uses <code class="leafygreen-ui-1l06pbn"> meta.type </code> as the group key to output one document per unique value. </p> </li> </ol> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Geospatial Queries <a class="headerlink leafygreen-ui-1kepx47" href="#geospatial-queries" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="geospatial-queries"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Time series collections only support the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/geoNear/#mongodb-pipeline-pipe.-geoNear"> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </a> aggregation stage for sorting <a class="leafygreen-ui-tqgtui" href="/docs/manual/geospatial-queries/#std-label-geospatial-queries"> geospatial data </a> from queries against <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere </a> indexes. You can't use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/near/#mongodb-query-op.-near"> <code class="leafygreen-ui-1l06pbn"> $near </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/nearSphere/#mongodb-query-op.-nearSphere"> <code class="leafygreen-ui-1l06pbn"> $nearSphere </code> </a> operators on time series collections </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-timeseries-limitations-doc-size"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Document Size <a class="headerlink leafygreen-ui-1kepx47" href="#document-size" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="document-size"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The maximum size for documents within a time series collection is 4 MB. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Extended Date Range <a class="headerlink leafygreen-ui-1kepx47" href="#extended-date-range" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="extended-date-range"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If a time series collection contains documents with <code class="leafygreen-ui-1l06pbn"> timeField </code> timestamps before <code class="leafygreen-ui-1l06pbn"> 1970-01-01T00:00:00.000Z </code> or after <code class="leafygreen-ui-1l06pbn"> 2038-01-19T03:14:07.000Z </code> , no documents are deleted from the collection by the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-TTL"> TTL "time to live" </a> feature. </p> <p class="leafygreen-ui-1kp3ins"> For details on TTL deletes, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/expire-data/#std-label-ttl-collections"> Expire Data from Collections by Setting TTL <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If your time series collection contains documents with <code class="leafygreen-ui-1l06pbn"> timeField </code> timestamps before <code class="leafygreen-ui-1l06pbn"> 1970-01-01T00:00:00.000Z </code> or after <code class="leafygreen-ui-1l06pbn"> 2038-01-19T03:14:07.000Z </code> , create an index on the <code class="leafygreen-ui-1l06pbn"> timeField </code> to optimize queries. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-timeseries-limitations-updates"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Updates <a class="headerlink leafygreen-ui-1kepx47" href="#updates" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="updates"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Update commands must meet the following requirements: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can only match on the <code class="leafygreen-ui-1l06pbn"> metaField </code> field value. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can only modify the <code class="leafygreen-ui-1l06pbn"> metaField </code> field value. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your update document can only contain <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators"> update operator </a> expressions. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your update command must not limit the number of documents to be updated. Set <code class="leafygreen-ui-1l06pbn"> multi: true </code> or use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateMany/#mongodb-method-db.collection.updateMany"> <code class="leafygreen-ui-1l06pbn"> updateMany() </code> </a> method. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your update command must not set <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.update/#std-label-update-upsert"> upsert: true <!-- --> . </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> To automatically delete old data, <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-automatic-removal/#std-label-set-up-automatic-removal"> set up automatic removal (TTL) <!-- --> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-timeseries-limitations-secondary-indexes"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Time Series Secondary Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#time-series-secondary-indexes" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="time-series-secondary-indexes"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> MongoDB partially supports the following indexes on time series collections: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can only create <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-multikey/#std-label-index-type-multikey"> multikey indexes </a> on the <code class="leafygreen-ui-1l06pbn"> metaField </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can only create <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index"> 2d indexes </a> on the <code class="leafygreen-ui-1l06pbn"> metaField </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can only create <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-sparse/#std-label-index-type-sparse"> sparse indexes </a> on the <code class="leafygreen-ui-1l06pbn"> metaField </code> . </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> MongoDB doesn't support the following index types on time series collections: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-type-text"> Text indexes </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-unique/#std-label-index-type-unique"> Unique indexes </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If there are <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary-index"> secondary indexes </a> on <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-manual-timeseries-collection"> time series collections </a> and you need to downgrade the feature compatibility version (fCV), you must first drop any secondary indexes that are incompatible with the downgraded fCV. For more information, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#mongodb-dbcommand-dbcmd.setFeatureCompatibilityVersion"> <code class="leafygreen-ui-1l06pbn"> setFeatureCompatibilityVersion </code> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Capped Collections <a class="headerlink leafygreen-ui-1kepx47" href="#capped-collections" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="capped-collections"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You cannot create a time series collection as a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/capped-collections/#std-label-manual-capped-collection"> capped collection <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Modification of Collection Type <a class="headerlink leafygreen-ui-1kepx47" href="#modification-of-collection-type" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="modification-of-collection-type"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can only set the collection type when you create a collection: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot convert an existing collection into a time series collection. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot convert a time series collection into a different collection type. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> To move data from an existing collection to a time series collection, <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-migrate-data-into-timeseries-collection/#std-label-migrate-data-into-a-timeseries-collection"> migrate data into a time series collection <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Modification of <code class="leafygreen-ui-1l06pbn"> timeField </code> and <code class="leafygreen-ui-1l06pbn"> metaField </code> <a class="headerlink leafygreen-ui-1kepx47" href="#modification-of-timefield-and-metafield" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="modification-of-timefield-and-metafield"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can only set a collection's <code class="leafygreen-ui-1l06pbn"> timeField </code> and <code class="leafygreen-ui-1l06pbn"> metaField </code> parameters when you create the collection. You cannot modify these parameters later. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-timeseries-limitations-granularity"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Granularity <a class="headerlink leafygreen-ui-1kepx47" href="#granularity" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="granularity"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Bucket Size <a class="headerlink leafygreen-ui-1kepx47" href="#bucket-size" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="bucket-size"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> For any configuration of granularity parameters, the maximum size of a bucket is 1000 measurements or 125KB of data, whichever is lower. MongoDB may also enforce a lower maximum size for high cardinality data with many unique values, so that the working set of buckets fits within the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/wiredtiger/#std-label-storage-wiredtiger"> WiredTiger cache <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Modifying Bucket Parameters <a class="headerlink leafygreen-ui-1kepx47" href="#modifying-bucket-parameters" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="modifying-bucket-parameters"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Once you set a collection's <code class="leafygreen-ui-1l06pbn"> granularity </code> or the custom bucketing parameters <code class="leafygreen-ui-1l06pbn"> bucketMaxSpanSeconds </code> and <code class="leafygreen-ui-1l06pbn"> bucketRoundingSeconds </code> , you can increase the time span covered by a bucket, but not decrease it. Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> command to modify the parameters. For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand({\n collMod: \"timeseries\",\n timeseries: { bucketMaxSpanSeconds: 3600, bucketRoundingSeconds: 3600 }\n})","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collMod</span>: <span class="lg-highlight-string">"timeseries"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeseries</span>: <!-- -->{ <span class="lg-highlight-attr">bucketMaxSpanSeconds</span>: <span class="lg-highlight-number">3600</span>, <span class="lg-highlight-attr">bucketRoundingSeconds</span>: <span class="lg-highlight-number">3600</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> bucketMaxSpanSeconds </code> and <code class="leafygreen-ui-1l06pbn"> bucketRoundingSeconds </code> must be equal. If you modify one parameter, you must also set the other to the same value. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-time-series-limitations-sharding"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Sharding <a class="headerlink leafygreen-ui-1kepx47" href="#sharding" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sharding"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Time series collections are subject to several sharding limitations. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sharding Administration Commands <a class="headerlink leafygreen-ui-1kepx47" href="#sharding-administration-commands" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sharding-administration-commands"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You cannot run sharding administration commands on sharded time series collections. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Shard Key Fields <a class="headerlink leafygreen-ui-1kepx47" href="#shard-key-fields" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="shard-key-fields"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When sharding time series collections, you can only specify the following fields in the shard key: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> metaField </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Sub-fields of <code class="leafygreen-ui-1l06pbn"> metaField </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> timeField </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> You may specify combinations of these fields in the shard key. No other fields, including <code class="leafygreen-ui-1l06pbn"> _id </code> , are allowed in the shard key pattern. </p> <p class="leafygreen-ui-1kp3ins"> When you specify the shard key: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> metaField </code> can be either a: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/hashed-sharding/#std-label-sharding-hashed-sharding"> Hashed shard key </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/ranged-sharding/#std-label-sharding-ranged"> Ranged shard key </a> </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> timeField </code> must be: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/ranged-sharding/#std-label-sharding-ranged"> ranged shard key </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> At the end of the shard key pattern </p> </li> </ul> </li> </ul> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Avoid specifying <strong> only </strong> the <code class="leafygreen-ui-1l06pbn"> timeField </code> as the shard key. Since the <code class="leafygreen-ui-1l06pbn"> timeField </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-choose-a-shard-key/#std-label-shard-key-monotonic"> increases monotonically </a> , it may result in all writes appearing on a single chunk within the cluster. Ideally, data is evenly distributed across chunks. </p> <p class="leafygreen-ui-1kp3ins"> To learn how to best choose a shard key, see: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-choose-a-shard-key/#std-label-sharding-shard-key-requirements"> Choose a Shard Key </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/blog/post/on-selecting-a-shard-key-for-mongodb?tck=docs_server" target="_self"> <span> MongoDB Blog: On Selecting a Shard Key for MongoDB <!-- --> . </span> </a> </p> </li> </ul> </div> </div> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, use of the <code class="leafygreen-ui-1l06pbn"> timeField </code> as a shard key in a time series collection is deprecated. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Resharding <a class="headerlink leafygreen-ui-1kepx47" href="#resharding" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="resharding"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You cannot reshard a sharded time series collection. However, you can <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-refine-a-shard-key/#std-label-shard-key-refine"> refine its shard key <!-- --> . </a> </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Transactions <a class="headerlink leafygreen-ui-1kepx47" href="#transactions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="transactions"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You cannot write to time series collections in <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions"> transactions <!-- --> . </a> </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB supports reads from time series collections in transactions. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Views <a class="headerlink leafygreen-ui-1kepx47" href="#views" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="views"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Time series collections are writable non-materialized <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/#std-label-views-landing-page"> views </a> . Limitations for views apply to time series collections. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot create a view from a time series bucket collection namespace (namely, a collection prefixed with <code class="leafygreen-ui-1l06pbn"> system.buckets </code> ). </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Snapshot Isolation <a class="headerlink leafygreen-ui-1kepx47" href="#snapshot-isolation" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="snapshot-isolation"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Read operations on time series collections with read concern <code class="leafygreen-ui-1l06pbn"> "snapshot" </code> guarantee snapshot isolation only in the absence of concurrent drop or rename operations on collections in the read operation. Re-creating a time series collection on the same namespace with different granularity setting does not yield full snapshot isolation. </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/geoNear/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $geoNear (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-geonear--aggregation-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-geonear--aggregation-"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="pipeline"> <dt> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-pipeline-pipe.-geoNear" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-pipeline-pipe.-geoNear"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Outputs documents in order of nearest to farthest from a specified point. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB removes the <code class="leafygreen-ui-1l06pbn"> limit </code> and <code class="leafygreen-ui-1l06pbn"> num </code> options for the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> stage as well as the default limit of 100 documents. To limit the results of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> , use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> stage with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/limit/#mongodb-pipeline-pipe.-limit"> <code class="leafygreen-ui-1l06pbn"> $limit </code> </a> stage. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> stage has the following prototype form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $geoNear: { &lt;geonear&gt; } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$geoNear</span>: <!-- -->{ <span class="lg-highlight-tag lg-highlight-xml">&lt;</span><span class="lg-highlight-name lg-highlight-tag lg-highlight-xml">geoNear</span><span class="lg-highlight-tag lg-highlight-xml"> </span><span class="lg-highlight-attr lg-highlight-tag lg-highlight-xml">options</span><span class="lg-highlight-tag lg-highlight-xml">&gt;</span><span class="lg-highlight-xml"> } }</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> operator accepts a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-document"> document </a> that contains the following <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> options. Specify all distances in the same units as those of the processed documents' coordinate system: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> distanceField </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The output field that contains the calculated distance. To specify a field within an embedded document, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-dot-notation"> dot notation <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> distanceMultiplier </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> number </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. The factor to multiply all distances returned by the query. For example, use the <code class="leafygreen-ui-1l06pbn"> distanceMultiplier </code> to convert radians, as returned by a spherical query, to kilometers by multiplying by the radius of the Earth. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> includeLocs </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. This specifies the output field that identifies the location used to calculate the distance. This option is useful when a location field contains multiple locations. To specify a field within an embedded document, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-dot-notation"> dot notation <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> key </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Specify the geospatial indexed field to use when calculating the distance. </p> <p class="leafygreen-ui-1kp3ins"> If your collection has multiple <code class="leafygreen-ui-1l06pbn"> 2d </code> and/or multiple <code class="leafygreen-ui-1l06pbn"> 2dsphere </code> indexes, you <strong> must </strong> use the <code class="leafygreen-ui-1l06pbn"> key </code> option to specify the indexed field path to use. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-pipeline-geoNear-key-param-example" target="_self"> <span> Specify Which Geospatial Index to Use </span> </a> provides a full example. </p> <p class="leafygreen-ui-1kp3ins"> If there is more than one <code class="leafygreen-ui-1l06pbn"> 2d </code> index or more than one <code class="leafygreen-ui-1l06pbn"> 2dsphere </code> index and you do not specify a <code class="leafygreen-ui-1l06pbn"> key </code> , MongoDB will return an error. </p> <p class="leafygreen-ui-1kp3ins"> If you do not specify the <code class="leafygreen-ui-1l06pbn"> key </code> , and you have at most only one <code class="leafygreen-ui-1l06pbn"> 2d </code> index and/or only one <code class="leafygreen-ui-1l06pbn"> 2dsphere </code> index, MongoDB looks first for a <code class="leafygreen-ui-1l06pbn"> 2d </code> index to use. If a <code class="leafygreen-ui-1l06pbn"> 2d </code> index does not exists, then MongoDB looks for a <code class="leafygreen-ui-1l06pbn"> 2dsphere </code> index to use. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> maxDistance </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> number </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The maximum distance from the center point that the documents <em> can </em> be. MongoDB limits the results to those documents that fall within the specified distance from the center point. Starting in version 7.2, you can specify a valid constant <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a number. </p> <p class="leafygreen-ui-1kp3ins"> Specify the distance in meters if the specified point is <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-GeoJSON"> GeoJSON </a> and in radians if the specified point is <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-legacy-coordinate-pairs"> legacy coordinate pairs <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> minDistance </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> number </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The minimum distance from the center point that the documents <em> can </em> be. MongoDB limits the results to those documents that fall outside the specified distance from the center point. Starting in version 7.2, you can specify a valid constant <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> that resolves to a number. </p> <p class="leafygreen-ui-1kp3ins"> Specify the distance in meters for GeoJSON data and in radians for legacy coordinate pairs. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> near </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> GeoJSON point or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-legacy-coordinate-pairs"> legacy coordinate pair </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> The point for which to find the closest documents. </p> <p class="leafygreen-ui-1kp3ins"> If using a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere </a> index, you can specify the point as either a GeoJSON point or legacy coordinate pair. </p> <p class="leafygreen-ui-1kp3ins"> If using a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index"> 2d </a> index, specify the point as a legacy coordinate pair. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> query </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Limits the results to the documents that match the query. The query syntax is the usual MongoDB <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/query-documents/#std-label-read-operations-query-argument"> read operation query </a> syntax. </p> <p class="leafygreen-ui-1kp3ins"> You cannot specify a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/near/#mongodb-query-op.-near"> <code class="leafygreen-ui-1l06pbn"> $near </code> </a> predicate in the <code class="leafygreen-ui-1l06pbn"> query </code> field of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> stage <!-- --> . </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> spherical </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. Determines how MongoDB calculates the distance between two points: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When <code class="leafygreen-ui-1l06pbn"> true </code> , MongoDB uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/nearSphere/#mongodb-query-op.-nearSphere"> <code class="leafygreen-ui-1l06pbn"> $nearSphere </code> </a> semantics and calculates distances using spherical geometry. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When <code class="leafygreen-ui-1l06pbn"> false </code> , MongoDB uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/near/#mongodb-query-op.-near"> <code class="leafygreen-ui-1l06pbn"> $near </code> </a> semantics: spherical geometry for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere </a> indexes and planar geometry for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index"> 2d </a> indexes. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <em> Default: false. </em> </p> </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> When using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> , consider that: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can only use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> as the first stage of a pipeline. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You must include the <code class="leafygreen-ui-1l06pbn"> distanceField </code> option. The <code class="leafygreen-ui-1l06pbn"> distanceField </code> option specifies the field that will contain the calculated distance. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> requires a <a class="leafygreen-ui-tqgtui" href="/docs/manual/geospatial-queries/#std-label-index-feature-geospatial"> geospatial index <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If you have more than one geospatial index on the collection, use the <code class="leafygreen-ui-1l06pbn"> keys </code> parameter to specify which field to use in the calculation. If you have only one geospatial index, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> implicitly uses the indexed field for the calculation. </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot specify a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/near/#mongodb-query-op.-near"> <code class="leafygreen-ui-1l06pbn"> $near </code> </a> predicate in the <code class="leafygreen-ui-1l06pbn"> query </code> field of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> stage <!-- --> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> no longer has a default limit of 100 documents. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.1, the <code class="leafygreen-ui-1l06pbn"> near </code> parameter supports the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-geoNear_let_example" target="_self"> <span> let option </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-geoNear_bounded_let_example" target="_self"> <span> bound let option <!-- --> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.3, you can use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> pipeline operator on any field in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-manual-timeseries-collection"> time series collection <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 6.0, you can create <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-partial/"> partial </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere </a> indexes on any field in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-manual-timeseries-collection"> time series collection <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/near/#mongodb-query-op.-near"> <code class="leafygreen-ui-1l06pbn"> $near </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/nearSphere/#mongodb-query-op.-nearSphere"> <code class="leafygreen-ui-1l06pbn"> $nearSphere </code> </a> , and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> validate that the type of the specified <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/geojson/#std-label-geojson-point"> GeoJSON points </a> is <code class="leafygreen-ui-1l06pbn"> Point </code> . Any other input type returns an error. </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Create a collection <code class="leafygreen-ui-1l06pbn"> places </code> with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.places.insertMany( [\n {\n name: \"Central Park\",\n location: { type: \"Point\", coordinates: [ -73.97, 40.77 ] },\n category: \"Parks\"\n },\n {\n name: \"Sara D. Roosevelt Park\",\n location: { type: \"Point\", coordinates: [ -73.9928, 40.7193 ] },\n category: \"Parks\"\n },\n {\n name: \"Polo Grounds\",\n location: { type: \"Point\", coordinates: [ -73.9375, 40.8303 ] },\n category: \"Stadiums\"\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">places</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">"Central Park"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">location</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Point"</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.97</span>, <span class="lg-highlight-number">40.77</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"Parks"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">"Sara D. Roosevelt Park"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">location</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Point"</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.9928</span>, <span class="lg-highlight-number">40.7193</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"Parks"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">"Polo Grounds"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">location</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Point"</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.9375</span>, <span class="lg-highlight-number">40.8303</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"Stadiums"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation creates a <code class="leafygreen-ui-1l06pbn"> 2dsphere </code> index on the <code class="leafygreen-ui-1l06pbn"> location </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.places.createIndex( { location: \"2dsphere\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">places</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">location</span>: <span class="lg-highlight-string">"2dsphere"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Maximum Distance <a class="headerlink leafygreen-ui-1kepx47" href="#maximum-distance" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="maximum-distance"> </div> </a> </h3> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB removes the <code class="leafygreen-ui-1l06pbn"> limit </code> and <code class="leafygreen-ui-1l06pbn"> num </code> options for the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> stage as well as the default limit of 100 documents. To limit the results of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> , use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> stage with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/limit/#mongodb-pipeline-pipe.-limit"> <code class="leafygreen-ui-1l06pbn"> $limit </code> </a> stage. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> places </code> collection above has a <code class="leafygreen-ui-1l06pbn"> 2dsphere </code> index. The following aggregation uses <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> to find documents with a location at most 2 meters from the center <code class="leafygreen-ui-1l06pbn"> [ -73.99279 , 40.719296 ] </code> and <code class="leafygreen-ui-1l06pbn"> category </code> equal to <code class="leafygreen-ui-1l06pbn"> Parks </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.places.aggregate([\n {\n $geoNear: {\n near: { type: \"Point\", coordinates: [ -73.99279 , 40.719296 ] },\n distanceField: \"dist.calculated\",\n maxDistance: 2,\n query: { category: \"Parks\" },\n includeLocs: \"dist.location\",\n spherical: true\n }\n }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">places</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$geoNear</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">near</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Point"</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.99279</span> <!-- -->, <span class="lg-highlight-number">40.719296</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">distanceField</span>: <span class="lg-highlight-string">"dist.calculated"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">maxDistance</span>: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">query</span>: <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"Parks"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">includeLocs</span>: <span class="lg-highlight-string">"dist.location"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">spherical</span>: <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The aggregation returns the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : 8,\n \"name\" : \"Sara D. Roosevelt Park\",\n \"category\" : \"Parks\",\n \"location\" : {\n \"type\" : \"Point\",\n \"coordinates\" : [ -73.9928, 40.7193 ]\n },\n \"dist\" : {\n \"calculated\" : 0.9539931676365992,\n \"location\" : {\n \"type\" : \"Point\",\n \"coordinates\" : [ -73.9928, 40.7193 ]\n }\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">8</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Sara D. Roosevelt Park"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"Parks"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"location"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"Point"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"coordinates"</span> <!-- -->: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.9928</span>, <span class="lg-highlight-number">40.7193</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dist"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"calculated"</span> <!-- -->: <span class="lg-highlight-number">0.9539931676365992</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"location"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"Point"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"coordinates"</span> <!-- -->: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.9928</span>, <span class="lg-highlight-number">40.7193</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The matching document contains two new fields: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> dist.calculated </code> field that contains the calculated distance, and </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> dist.location </code> field that contains the location used in the calculation. </p> </li> </ul> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Minimum Distance <a class="headerlink leafygreen-ui-1kepx47" href="#minimum-distance" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="minimum-distance"> </div> </a> </h3> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB removes the <code class="leafygreen-ui-1l06pbn"> limit </code> and <code class="leafygreen-ui-1l06pbn"> num </code> options for the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> stage as well as the default limit of 100 documents. To limit the results of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> , use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> stage with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/limit/#mongodb-pipeline-pipe.-limit"> <code class="leafygreen-ui-1l06pbn"> $limit </code> </a> stage. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example uses the option <code class="leafygreen-ui-1l06pbn"> minDistance </code> to specify the minimum distance from the center point that the documents can be. The following aggregation finds all documents with a location at least 2 meters from the center <code class="leafygreen-ui-1l06pbn"> [ -73.99279 , 40.719296 ] </code> and <code class="leafygreen-ui-1l06pbn"> category </code> equal to <code class="leafygreen-ui-1l06pbn"> Parks </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.places.aggregate([\n {\n $geoNear: {\n near: { type: \"Point\", coordinates: [ -73.99279 , 40.719296 ] },\n distanceField: \"dist.calculated\",\n minDistance: 2,\n query: { category: \"Parks\" },\n includeLocs: \"dist.location\",\n spherical: true\n }\n }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">places</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$geoNear</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">near</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Point"</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.99279</span> <!-- -->, <span class="lg-highlight-number">40.719296</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">distanceField</span>: <span class="lg-highlight-string">"dist.calculated"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">minDistance</span>: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">query</span>: <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"Parks"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">includeLocs</span>: <span class="lg-highlight-string">"dist.location"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">spherical</span>: <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-geoNear_let_example"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> $geoNear with the <code class="leafygreen-ui-1l06pbn"> let </code> option <a class="headerlink leafygreen-ui-1kepx47" href="#-geonear-with-the-let-option" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-geonear-with-the-let-option"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> In this example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> let </code> option is used to set an array value of <code class="leafygreen-ui-1l06pbn"> [-73.99279,40.719296] </code> to the variable <code class="leafygreen-ui-1l06pbn"> $pt </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $pt </code> is specified as a <code class="leafygreen-ui-1l06pbn"> let </code> option to the <code class="leafygreen-ui-1l06pbn"> near </code> parameter in the <code class="leafygreen-ui-1l06pbn"> $geoNear </code> stage. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.places.aggregate(\n[\n {\n \"$geoNear\":\n {\n \"near\":\"$$pt\",\n \"distanceField\":\"distance\",\n \"maxDistance\":2,\n \"query\":{\"category\":\"Parks\"},\n \"includeLocs\":\"dist.location\",\n \"spherical\":true\n }\n }\n],\n{\n \"let\":{ \"pt\": [ -73.99279, 40.719296 ] }\n}\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">places</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$geoNear"</span>:</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"near"</span>:<span class="lg-highlight-string">"$$pt"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"distanceField"</span>:<span class="lg-highlight-string">"distance"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"maxDistance"</span>:<span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"query"</span>:<!-- -->{<span class="lg-highlight-string">"category"</span>:<span class="lg-highlight-string">"Parks"</span>}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"includeLocs"</span>:<span class="lg-highlight-string">"dist.location"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"spherical"</span>:<span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"let"</span>:<!-- -->{ <span class="lg-highlight-string">"pt"</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.99279</span>, <span class="lg-highlight-number">40.719296</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The aggregation returns all documents with: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A location at most 2 meters from the point defined in the <code class="leafygreen-ui-1l06pbn"> let </code> variable </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A <code class="leafygreen-ui-1l06pbn"> category </code> equal to <code class="leafygreen-ui-1l06pbn"> Parks </code> . </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: ObjectId(\"61715cf9b0c1d171bb498fd7\"),\n name: 'Sara D. Roosevelt Park',\n location: { type: 'Point', coordinates: [ -73.9928, 40.7193 ] },\n category: 'Parks',\n distance: 1.4957325341976439e-7,\n dist: { location: { type: 'Point', coordinates: [ -73.9928, 40.7193 ] } }\n},\n{\n _id: ObjectId(\"61715cf9b0c1d171bb498fd6\"),\n name: 'Central Park',\n location: { type: 'Point', coordinates: [ -73.97, 40.77 ] },\n category: 'Parks',\n distance: 0.0009348548688841822,\n dist: { location: { type: 'Point', coordinates: [ -73.97, 40.77 ] } }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"61715cf9b0c1d171bb498fd7"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">'Sara D. Roosevelt Park'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">location</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">'Point'</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.9928</span>, <span class="lg-highlight-number">40.7193</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">'Parks'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">distance</span>: <span class="lg-highlight-number">1.4957325341976439e-7</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dist</span>: <!-- -->{ <span class="lg-highlight-attr">location</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">'Point'</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.9928</span>, <span class="lg-highlight-number">40.7193</span> ] } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"61715cf9b0c1d171bb498fd6"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">'Central Park'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">location</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">'Point'</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.97</span>, <span class="lg-highlight-number">40.77</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">'Parks'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">distance</span>: <span class="lg-highlight-number">0.0009348548688841822</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dist</span>: <!-- -->{ <span class="lg-highlight-attr">location</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">'Point'</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.97</span>, <span class="lg-highlight-number">40.77</span> ] } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-geoNear_bounded_let_example"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> $geoNear with Bound <code class="leafygreen-ui-1l06pbn"> let </code> Option <a class="headerlink leafygreen-ui-1kepx47" href="#-geonear-with-bound-let-option" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-geonear-with-bound-let-option"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> let </code> option can bind a variable which can be used in a $geoNear query. </p> <p class="leafygreen-ui-1kp3ins"> In this example, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/lookup/#mongodb-pipeline-pipe.-lookup"> <code class="leafygreen-ui-1l06pbn"> $lookup </code> </a> uses: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> let </code> to define <code class="leafygreen-ui-1l06pbn"> $pt </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> in the <code class="leafygreen-ui-1l06pbn"> pipeline </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $pt </code> to define <code class="leafygreen-ui-1l06pbn"> near </code> in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> pipeline stage. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.places.aggregate( [\n {\n $lookup: {\n from: \"places\",\n let: { pt: \"$location\" },\n pipeline: [\n {\n $geoNear: {\n near: \"$$pt\",\n distanceField: \"distance\"\n }\n }\n ],\n as: \"joinedField\"\n }\n },\n {\n $match: { name: \"Sara D. Roosevelt Park\" }\n }\n] );","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">places</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$lookup</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">from</span>: <span class="lg-highlight-string">"places"</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">let</span>: <!-- -->{ <span class="lg-highlight-attr">pt</span>: <span class="lg-highlight-string">"$location"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pipeline</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$geoNear</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">near</span>: <span class="lg-highlight-string">"$$pt"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">distanceField</span>: <span class="lg-highlight-string">"distance"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">as</span>: <span class="lg-highlight-string">"joinedField"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$match</span>: <!-- -->{ <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">"Sara D. Roosevelt Park"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The aggregation returns a document with: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The 'Sara D. Roosevelt Park' document as the main document. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Every document in the places collection as subDocuments using the <code class="leafygreen-ui-1l06pbn"> $pt </code> variable for calculating distance. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: ObjectId(\"61715cf9b0c1d171bb498fd7\"),\n name: 'Sara D. Roosevelt Park',\n location: { type: 'Point', coordinates: [ -73.9928, 40.7193 ] },\n category: 'Parks',\n joinedField: [\n {\n _id: ObjectId(\"61715cf9b0c1d171bb498fd7\"),\n name: 'Sara D. Roosevelt Park',\n location: { type: 'Point', coordinates: [ -73.9928, 40.7193 ] },\n category: 'Parks',\n distance: 0\n },\n {\n _id: ObjectId(\"61715cf9b0c1d171bb498fd6\"),\n name: 'Central Park',\n location: { type: 'Point', coordinates: [ -73.97, 40.77 ] },\n category: 'Parks',\n distance: 5962.448255234964\n },\n {\n _id: ObjectId(\"61715cfab0c1d171bb498fd8\"),\n name: 'Polo Grounds',\n location: { type: 'Point', coordinates: [ -73.9375, 40.8303 ] },\n category: 'Stadiums',\n distance: 13206.535424939102\n }\n ]\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"61715cf9b0c1d171bb498fd7"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">'Sara D. Roosevelt Park'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">location</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">'Point'</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.9928</span>, <span class="lg-highlight-number">40.7193</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">'Parks'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">joinedField</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"61715cf9b0c1d171bb498fd7"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">'Sara D. Roosevelt Park'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">location</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">'Point'</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.9928</span>, <span class="lg-highlight-number">40.7193</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">'Parks'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">distance</span>: <span class="lg-highlight-number">0</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"61715cf9b0c1d171bb498fd6"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">'Central Park'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">location</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">'Point'</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.97</span>, <span class="lg-highlight-number">40.77</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">'Parks'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">distance</span>: <span class="lg-highlight-number">5962.448255234964</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"61715cfab0c1d171bb498fd8"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">'Polo Grounds'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">location</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">'Point'</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.9375</span>, <span class="lg-highlight-number">40.8303</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">'Stadiums'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">distance</span>: <span class="lg-highlight-number">13206.535424939102</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-pipeline-geoNear-key-param-example"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify Which Geospatial Index to Use <a class="headerlink leafygreen-ui-1kepx47" href="#specify-which-geospatial-index-to-use" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="specify-which-geospatial-index-to-use"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Consider a <code class="leafygreen-ui-1l06pbn"> places </code> collection that has a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere </a> index on the <code class="leafygreen-ui-1l06pbn"> location </code> field and a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index"> 2d </a> index on the <code class="leafygreen-ui-1l06pbn"> legacy </code> field. </p> <p class="leafygreen-ui-1kp3ins"> A document in the <code class="leafygreen-ui-1l06pbn"> places </code> collection resembles the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : 3,\n \"name\" : \"Polo Grounds\",\n \"location\": {\n \"type\" : \"Point\",\n \"coordinates\" : [ -73.9375, 40.8303 ]\n },\n \"legacy\" : [ -73.9375, 40.8303 ],\n \"category\" : \"Stadiums\"\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Polo Grounds"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"location"</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"Point"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"coordinates"</span> <!-- -->: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.9375</span>, <span class="lg-highlight-number">40.8303</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"legacy"</span> <!-- -->: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.9375</span>, <span class="lg-highlight-number">40.8303</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"Stadiums"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example uses the <code class="leafygreen-ui-1l06pbn"> key </code> option to specify that the aggregation should use the <code class="leafygreen-ui-1l06pbn"> location </code> field values for the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> operation rather than the <code class="leafygreen-ui-1l06pbn"> legacy </code> field values. The pipeline also uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/limit/#mongodb-pipeline-pipe.-limit"> <code class="leafygreen-ui-1l06pbn"> $limit </code> </a> to return at most 5 documents. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB removes the <code class="leafygreen-ui-1l06pbn"> limit </code> and <code class="leafygreen-ui-1l06pbn"> num </code> options for the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> stage as well as the default limit of 100 documents. To limit the results of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> , use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-geoNear" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </span> </a> stage with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/limit/#mongodb-pipeline-pipe.-limit"> <code class="leafygreen-ui-1l06pbn"> $limit </code> </a> stage. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.places.aggregate([\n {\n $geoNear: {\n near: { type: \"Point\", coordinates: [ -73.98142 , 40.71782 ] },\n key: \"location\",\n distanceField: \"dist.calculated\",\n query: { \"category\": \"Parks\" }\n }\n },\n { $limit: 5 }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">places</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$geoNear</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">near</span>: <!-- -->{ <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"Point"</span>, <span class="lg-highlight-attr">coordinates</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">73.98142</span> <!-- -->, <span class="lg-highlight-number">40.71782</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">key</span>: <span class="lg-highlight-string">"location"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">distanceField</span>: <span class="lg-highlight-string">"dist.calculated"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">query</span>: <!-- -->{ <span class="lg-highlight-string">"category"</span>: <span class="lg-highlight-string">"Parks"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$limit</span>: <span class="lg-highlight-number">5</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The aggregation returns the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : 8,\n \"name\" : \"Sara D. Roosevelt Park\",\n \"location\" : {\n \"type\" : \"Point\",\n \"coordinates\" : [\n -73.9928,\n 40.7193\n ]\n },\n \"category\" : \"Parks\",\n \"dist\" : {\n \"calculated\" : 974.175764916902\n }\n}\n{\n \"_id\" : 1,\n \"name\" : \"Central Park\",\n \"location\" : {\n \"type\" : \"Point\",\n \"coordinates\" : [\n -73.97,\n 40.77\n ]\n },\n \"legacy\" : [\n -73.97,\n 40.77\n ],\n \"category\" : \"Parks\",\n \"dist\" : {\n \"calculated\" : 5887.92792958097\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">8</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Sara D. Roosevelt Park"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"location"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"Point"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"coordinates"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->-<span class="lg-highlight-number">73.9928</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-number">40.7193</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"Parks"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dist"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"calculated"</span> <!-- -->: <span class="lg-highlight-number">974.175764916902</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"name"</span> <!-- -->: <span class="lg-highlight-string">"Central Park"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"location"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"Point"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"coordinates"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->-<span class="lg-highlight-number">73.97</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-number">40.77</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"legacy"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->-<span class="lg-highlight-number">73.97</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-number">40.77</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"category"</span> <!-- -->: <span class="lg-highlight-string">"Parks"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"dist"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"calculated"</span> <!-- -->: <span class="lg-highlight-number">5887.92792958097</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/core/csfle/reference/encryption-components/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> CSFLE Encryption Components <a class="headerlink leafygreen-ui-1kepx47" href="#csfle-encryption-components" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="csfle-encryption-components"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#diagram" target="_self"> <span> Diagram </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#components" target="_self"> <span> Components </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#libmongocrypt" target="_self"> <span> libmongocrypt </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#mongocryptd" target="_self"> <span> mongocryptd </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#key-vault-collection" target="_self"> <span> Key Vault collection </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#key-management-system" target="_self"> <span> Key Management System </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#mongodb-cluster" target="_self"> <span> MongoDB Cluster </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Diagram <a class="headerlink leafygreen-ui-1kepx47" href="#diagram" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="diagram"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following diagram illustrates the relationships between a MongoDB driver or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> and each component of Client-Side Field Level Encryption (CSFLE): </p> <div class="figure css-5vkxs0" style="width:600px"> <img alt="Diagram of relationships between driver and encryption components" class="leafygreen-ui-1qnf57e" height="300" src="/docs/manual/images/client-side-field-level-encryption-diagram.svg" style="--border-color:#C1C7C6" width="600"/> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Components <a class="headerlink leafygreen-ui-1kepx47" href="#components" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="components"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following sections discuss the individual components of the preceding diagram. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> libmongocrypt <a class="headerlink leafygreen-ui-1kepx47" href="#libmongocrypt" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="libmongocrypt"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> libmongocrypt </code> is the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://github.com/mongodb/libmongocrypt" rel="noopener noreferrer"> <span> Apache-licensed open-source </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> core cryptography library used by the official MongoDB drivers and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to power Client-Side Field Level Encryption. Some drivers may require specific integration steps to install or link the library. </p> <p class="leafygreen-ui-1kp3ins"> To view steps for installing <code class="leafygreen-ui-1l06pbn"> libmongocrypt </code> , see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/reference/libmongocrypt/#std-label-csfle-reference-libmongocrypt"> libmongocrypt reference page <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> mongocryptd <a class="headerlink leafygreen-ui-1kepx47" href="#mongocryptd" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongocryptd"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> mongocryptd </code> supports automatic encryption and is only available with MongoDB Enterprise. <code class="leafygreen-ui-1l06pbn"> mongocryptd </code> does not perform cryptographic functions. </p> <p class="leafygreen-ui-1kp3ins"> To learn more about <code class="leafygreen-ui-1l06pbn"> mongocryptd </code> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/reference/install-library/#std-label-csfle-reference-mongocryptd"> Install and Configure a CSFLE Library <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Key Vault collection <a class="headerlink leafygreen-ui-1kepx47" href="#key-vault-collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="key-vault-collection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The Key Vault collection is a standard MongoDB collection that stores all Data Encryption Keys used to encrypt application data. Data Encryption Keys are themselves encrypted using a Customer Master Key ( <span class="leafygreen-ui-vm4wms" tabindex="0"> CMK </span> ) prior to storage in the Key Vault collection. You can host your Key Vault collection on a different MongoDB cluster than the cluster storing your encrypted application data. </p> <p class="leafygreen-ui-1kp3ins"> To learn more about the Key Vault collection, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/keys-key-vaults/#std-label-qe-reference-keys-key-vaults"> Encryption Keys and Key Vaults <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Key Management System <a class="headerlink leafygreen-ui-1kepx47" href="#key-management-system" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="key-management-system"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The Key Management System ( <span class="leafygreen-ui-vm4wms" tabindex="0"> KMS </span> ) stores the Customer Master Key ( <span class="leafygreen-ui-vm4wms" tabindex="0"> CMK </span> ) used to encrypt Data Encryption Keys. </p> <p class="leafygreen-ui-1kp3ins"> To view a list of all <span class="leafygreen-ui-vm4wms" tabindex="0"> KMS </span> providers MongoDB supports, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers"> KMS Providers <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> MongoDB Cluster <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-cluster" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-cluster"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The MongoDB cluster which stores the encrypted data may also enforce Client-Side Field Level Encryption. For more information on server-side schema enforcement, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/reference/server-side-schema/#std-label-csfle-reference-server-side-schema"> CSFLE Server-Side Schema Enforcement <!-- --> . </a> </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/program/mongod/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> <code class="leafygreen-ui-1l06pbn"> mongod </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongod" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongod"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#synopsis" target="_self"> <span> Synopsis </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#considerations" target="_self"> <span> Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#options" target="_self"> <span> Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#core-options" target="_self"> <span> Core Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#ldap-authentication-or-authorization-options" target="_self"> <span> LDAP Authentication or Authorization Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#storage-options" target="_self"> <span> Storage Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#wiredtiger-options" target="_self"> <span> WiredTiger Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#replication-options" target="_self"> <span> Replication Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#sharded-cluster-options" target="_self"> <span> Sharded Cluster Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#tls-options" target="_self"> <span> TLS Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#profiler-options" target="_self"> <span> Profiler Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#audit-options" target="_self"> <span> Audit Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#inmemory-options" target="_self"> <span> inMemory Options </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#encryption-key-management-options" target="_self"> <span> Encryption Key Management Options </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Synopsis <a class="headerlink leafygreen-ui-1kepx47" href="#synopsis" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="synopsis"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> mongod </code> is the primary daemon process for the MongoDB system. It handles data requests, manages data access, and performs background management operations. </p> <p class="leafygreen-ui-1kp3ins"> This document provides a complete overview of all command line options for <code class="leafygreen-ui-1l06pbn"> mongod </code> . These command line options are primarily useful for testing: In common operation, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/"> configuration file options </a> to control the behavior of your database. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-file-settings-command-line-options-mapping/#std-label-conf-file-command-line-mapping"> Self-Managed Configuration File Settings and Command-Line Options Mapping </a> </p> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB disables support for TLS 1.0 encryption on systems where TLS 1.1+ is available. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Deployments hosted in the following environments use <code class="leafygreen-ui-1l06pbn"> mongod </code> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB Atlas manages the <code class="leafygreen-ui-1l06pbn"> mongod </code> for all MongoDB Atlas deployments. </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#considerations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="considerations"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> includes a <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/full-time-diagnostic-data-capture/#std-label-ftdc-stub"> Full Time Diagnostic Data Capture </a> mechanism to assist MongoDB engineers with troubleshooting deployments. If this thread fails, it terminates the originating process. To avoid the most common failures, confirm that the user running the process has permissions to create the FTDC <code class="leafygreen-ui-1l06pbn"> diagnostic.data </code> directory. For <code class="leafygreen-ui-1l06pbn"> mongod </code> the directory is within <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> storage.dbPath </code> </a> . For <code class="leafygreen-ui-1l06pbn"> mongos </code> it is parallel to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-systemLog.path"> <code class="leafygreen-ui-1l06pbn"> systemLog.path </code> . </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-mongod-options"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Options <a class="headerlink leafygreen-ui-1kepx47" href="#options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="options"> </div> </a> </h2> <div> <p> <em> Changed in version 6.1 </em> : <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MongoDB always enables journaling. As a result, MongoDB removes the <code class="leafygreen-ui-1l06pbn"> storage.journal.enabled </code> option and the corresponding <code class="leafygreen-ui-1l06pbn"> --journal </code> and <code class="leafygreen-ui-1l06pbn"> --nojournal </code> command-line options. </p> </li> </ul> </p> </div> <div> <p> <em> Changed in version 5.2 </em> : <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MongoDB removes the <code class="leafygreen-ui-1l06pbn"> --cpu </code> command-line option. </p> </li> </ul> </p> </div> <div> <p> <em> Changed in version 5.0 </em> : <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MongoDB removes the <code class="leafygreen-ui-1l06pbn"> --serviceExecutor </code> command-line option and the corresponding <code class="leafygreen-ui-1l06pbn"> net.serviceExecutor </code> configuration option. </p> </li> </ul> </p> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Core Options <a class="headerlink leafygreen-ui-1kepx47" href="#core-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="core-options"> </div> </a> </h3> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --help, -h </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--help" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--help"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns information on the options and use of <code class="leafygreen-ui-1l06pbn"> mongod </code> . </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --version </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--version" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--version"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns the <code class="leafygreen-ui-1l06pbn"> mongod </code> release number. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --config &lt;filename&gt;, -f &lt;filename&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--config" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--config"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies a configuration file for runtime configuration options. The configuration file is the preferred method for runtime configuration of <code class="leafygreen-ui-1l06pbn"> mongod </code> . The options are equivalent to the command-line configuration options. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/"> Self-Managed Configuration File Options </a> for more information. </p> <p class="leafygreen-ui-1kp3ins"> Ensure the configuration file uses ASCII encoding. The <code class="leafygreen-ui-1l06pbn"> mongod </code> instance does not support configuration files with non-ASCII encoding, including UTF-8. </p> </dd> </dl> <span class="leafygreen-ui-1qnjd6d" id="std-label-mongod-configExpand"> </span> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --configExpand &lt;none|rest|exec&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--configExpand" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--configExpand"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : none </p> <p class="leafygreen-ui-1kp3ins"> Enables using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/expansion-directives/#std-label-externally-sourced-values"> Expansion Directives </a> in configuration files. Expansion directives allow you to set externally sourced values for configuration file options. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--configExpand" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --configExpand </code> </span> </a> supports the following expansion directives: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width: 20%;"/> <col style="width: 40%;"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> none </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Default. <code class="leafygreen-ui-1l06pbn"> mongod </code> does not expand expansion directives. <code class="leafygreen-ui-1l06pbn"> mongod </code> fails to start if any configuration file settings use expansion directives. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> rest </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mongod </code> expands <code class="leafygreen-ui-1l06pbn"> __rest </code> expansion directives when parsing the configuration file. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> exec </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mongod </code> expands <code class="leafygreen-ui-1l06pbn"> __exec </code> expansion directives when parsing the configuration file. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> You can specify multiple expansion directives as a comma-separated list, for example: <code class="leafygreen-ui-1l06pbn"> rest, exec </code> . If the configuration file contains expansion directives not specified to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--configExpand" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --configExpand </code> </span> </a> , the <code class="leafygreen-ui-1l06pbn"> mongod </code> returns an error and terminates. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/expansion-directives/#std-label-externally-sourced-values"> Externally Sourced Configuration File Values for Self-Managed Deployments </a> for configuration files for more information on expansion directives. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --verbose, -v </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--verbose" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--verbose"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Increases the amount of internal reporting returned on standard output or in log files. Increase the verbosity with the <code class="leafygreen-ui-1l06pbn"> -v </code> form by including the option multiple times, for example: <code class="leafygreen-ui-1l06pbn"> -vvvvv </code> . </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Starting in version 4.2, MongoDB includes the Debug verbosity level (1-5) in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-severity-levels"> log messages </a> . For example, if the verbosity level is 2, MongoDB logs <code class="leafygreen-ui-1l06pbn"> D2 </code> . In previous versions, MongoDB log messages only specified <code class="leafygreen-ui-1l06pbn"> D </code> for Debug level. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --quiet </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--quiet" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--quiet"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Runs <code class="leafygreen-ui-1l06pbn"> mongod </code> in a quiet mode that attempts to limit the amount of output. </p> <p class="leafygreen-ui-1kp3ins"> This option suppresses: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> output from <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-database-command"> database commands </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> replication activity </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> connection accepted events </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> connection closed events </p> </li> </ul> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --port &lt;port&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--port" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--port"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 27017 if <code class="leafygreen-ui-1l06pbn"> mongod </code> is not a shard member or a config server member </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 27018 if <code class="leafygreen-ui-1l06pbn"> mongod </code> is a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--shardsvr" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> shard member </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 27019 if <code class="leafygreen-ui-1l06pbn"> mongod </code> is a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--configsvr" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> config server member </code> </span> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The TCP port on which the MongoDB instance listens for client connections. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> --port </code> option accepts a range of values between <code class="leafygreen-ui-1l06pbn"> 0 </code> and <code class="leafygreen-ui-1l06pbn"> 65535 </code> . Setting the port to <code class="leafygreen-ui-1l06pbn"> 0 </code> configures <code class="leafygreen-ui-1l06pbn"> mongod </code> to use an arbitrary port assigned by the operating system. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --bind_ip &lt;hostnames|ipaddresses|Unix domain socket paths&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--bind_ip" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--bind_ip"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : localhost </p> <p class="leafygreen-ui-1kp3ins"> The hostnames and/or IP addresses and/or full Unix domain socket paths on which <code class="leafygreen-ui-1l06pbn"> mongod </code> should listen for client connections. You may attach <code class="leafygreen-ui-1l06pbn"> mongod </code> to any interface. To bind to multiple addresses, enter a list of comma-separated values. </p> <div class="leafygreen-ui-vg7qwp" role="note"> <h2 class="leafygreen-ui-2xicti"> Example </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> localhost,/tmp/mongod.sock </strong> </h3> <div class="leafygreen-ui-9mycqc"> </div> </div> <p class="leafygreen-ui-1kp3ins"> You can specify both IPv4 and IPv6 addresses, or hostnames that resolve to an IPv4 or IPv6 address. </p> <div class="leafygreen-ui-vg7qwp" role="note"> <h2 class="leafygreen-ui-2xicti"> Example </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> localhost, 2001:0DB8:e132:ba26:0d5c:2774:e7f9:d513 </strong> </h3> <div class="leafygreen-ui-9mycqc"> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If specifying an IPv6 address <em> or </em> a hostname that resolves to an IPv6 address to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--bind_ip" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> </span> </a> , you must start <code class="leafygreen-ui-1l06pbn"> mongod </code> with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ipv6" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ipv6 </code> </span> </a> to enable IPv6 support. Specifying an IPv6 address to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--bind_ip" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> </span> </a> does not enable IPv6 support. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> If specifying a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/Link-local_address#IPv6" rel="noopener noreferrer"> <span> link-local IPv6 address </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> ( <code class="leafygreen-ui-1l06pbn"> fe80::/10 </code> ), you must append the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses_(with_zone_index)" rel="noopener noreferrer"> <span> zone index </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> to that address (i.e. <code class="leafygreen-ui-1l06pbn"> fe80::&lt;address&gt;%&lt;adapter-name&gt; </code> ). </p> <div class="leafygreen-ui-vg7qwp" role="note"> <h2 class="leafygreen-ui-2xicti"> Example </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> localhost,fe80::a00:27ff:fee0:1fcf%enp0s3 </strong> </h3> <div class="leafygreen-ui-9mycqc"> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To avoid configuration updates due to IP address changes, use DNS hostnames instead of IP addresses. It is particularly important to use a DNS hostname instead of an IP address when configuring replica set members or sharded cluster members. </p> <p class="leafygreen-ui-1kp3ins"> Use hostnames instead of IP addresses to configure clusters across a split network horizon. Starting in MongoDB 5.0, nodes that are only configured with an IP address fail startup validation and do not start. </p> </div> </div> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Before you bind your instance to a publicly-accessible IP address, you must secure your cluster from unauthorized access. For a complete list of security recommendations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-security-checklist"> Security Checklist for Self-Managed Deployments </a> . At minimum, consider <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-checklist-auth"> enabling authentication </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-hardening/#std-label-network-config-hardening"> hardening network infrastructure. </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information about IP Binding, refer to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-mongodb-configuration/"> IP Binding in Self-Managed Deployments </a> documentation. </p> <p class="leafygreen-ui-1kp3ins"> To bind to all IPv4 addresses, enter <code class="leafygreen-ui-1l06pbn"> 0.0.0.0 </code> . </p> <p class="leafygreen-ui-1kp3ins"> To bind to all IPv4 and IPv6 addresses, enter <code class="leafygreen-ui-1l06pbn"> ::,0.0.0.0 </code> or an asterisk <code class="leafygreen-ui-1l06pbn"> "*" </code> (enclose the asterisk in quotes to avoid filename pattern expansion). Alternatively, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIpAll"> <code class="leafygreen-ui-1l06pbn"> net.bindIpAll </code> </a> setting. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> and <code class="leafygreen-ui-1l06pbn"> --bind_ip_all </code> are mutually exclusive. Specifying both options causes <code class="leafygreen-ui-1l06pbn"> mongod </code> to throw an error and terminate. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The command-line option <code class="leafygreen-ui-1l06pbn"> --bind </code> overrides the configuration file setting <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> . </a> </p> </li> </ul> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --bind_ip_all </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--bind_ip_all" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--bind_ip_all"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> If specified, the <code class="leafygreen-ui-1l06pbn"> mongod </code> instance binds to all IPv4 addresses (i.e. <code class="leafygreen-ui-1l06pbn"> 0.0.0.0 </code> ). If <code class="leafygreen-ui-1l06pbn"> mongod </code> starts with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ipv6" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ipv6 </code> </span> </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--bind_ip_all" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --bind_ip_all </code> </span> </a> also binds to all IPv6 addresses (i.e. <code class="leafygreen-ui-1l06pbn"> :: </code> ). </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> mongod </code> only supports IPv6 if started with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ipv6" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ipv6 </code> </span> </a> . Specifying <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--bind_ip_all" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --bind_ip_all </code> </span> </a> alone does not enable IPv6 support. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Before you bind your instance to a publicly-accessible IP address, you must secure your cluster from unauthorized access. For a complete list of security recommendations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-security-checklist"> Security Checklist for Self-Managed Deployments </a> . At minimum, consider <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-checklist-auth"> enabling authentication </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-hardening/#std-label-network-config-hardening"> hardening network infrastructure. </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information about IP Binding, refer to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-mongodb-configuration/"> IP Binding in Self-Managed Deployments </a> documentation. </p> <p class="leafygreen-ui-1kp3ins"> Alternatively, you can set the <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> option to <code class="leafygreen-ui-1l06pbn"> ::,0.0.0.0 </code> or to an asterisk <code class="leafygreen-ui-1l06pbn"> "*" </code> (enclose the asterisk in quotes to avoid filename pattern expansion). </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> and <code class="leafygreen-ui-1l06pbn"> --bind_ip_all </code> are mutually exclusive. That is, you can specify one or the other, but not both. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --clusterIpSourceAllowlist &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--clusterIpSourceAllowlist" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--clusterIpSourceAllowlist"> </div> </a> </dt> <dd> <div> <p> <em> New in version 5.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> A list of IP addresses/CIDR ( <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc4632" rel="noopener noreferrer"> <span> Classless Inter-Domain Routing </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> ) ranges against which the <code class="leafygreen-ui-1l06pbn"> mongod </code> validates authentication requests from other members of the replica set and, if part of a sharded cluster, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances. The <code class="leafygreen-ui-1l06pbn"> mongod </code> verifies that the originating IP is either explicitly in the list or belongs to a CIDR range in the list. If the IP address is not present, the server does not authenticate the <code class="leafygreen-ui-1l06pbn"> mongod </code> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--clusterIpSourceAllowlist" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --clusterIpSourceAllowlist </code> </span> </a> has no effect on a <code class="leafygreen-ui-1l06pbn"> mongod </code> started without <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-authentication"> authentication. </a> </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--clusterIpSourceAllowlist" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --clusterIpSourceAllowlist </code> </span> </a> accepts multiple comma-separated IPv4/6 addresses or Classless Inter-Domain Routing ( <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc4632" rel="noopener noreferrer"> <span> CIDR </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> ) ranges: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --clusterIpSourceAllowlist 192.0.2.0/24,127.0.0.1,::1","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --clusterIpSourceAllowlist 192.0.2.0/24,127.0.0.1,::1</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Ensure <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--clusterIpSourceAllowlist" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --clusterIpSourceAllowlist </code> </span> </a> includes the IP address <em> or </em> CIDR ranges that include the IP address of each replica set member or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> in the deployment to ensure healthy communication between cluster components. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --clusterIpSourceWhitelist &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--clusterIpSourceWhitelist" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--clusterIpSourceWhitelist"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Deprecated in version 5.0: </em> Use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--clusterIpSourceAllowlist" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --clusterIpSourceAllowlist </code> </span> </a> instead. </p> <p class="leafygreen-ui-1kp3ins"> A list of IP addresses/CIDR ( <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc4632" rel="noopener noreferrer"> <span> Classless Inter-Domain Routing </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> ) ranges against which the <code class="leafygreen-ui-1l06pbn"> mongod </code> validates authentication requests from other members of the replica set and, if part of a sharded cluster, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances. The <code class="leafygreen-ui-1l06pbn"> mongod </code> verifies that the originating IP is either explicitly in the list or belongs to a CIDR range in the list. If the IP address is not present, the server does not authenticate the <code class="leafygreen-ui-1l06pbn"> mongod </code> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--clusterIpSourceWhitelist" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --clusterIpSourceWhitelist </code> </span> </a> has no effect on a <code class="leafygreen-ui-1l06pbn"> mongod </code> started without <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-authentication"> authentication. </a> </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--clusterIpSourceWhitelist" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --clusterIpSourceWhitelist </code> </span> </a> accepts multiple comma-separated IPv4/6 addresses or Classless Inter-Domain Routing ( <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc4632" rel="noopener noreferrer"> <span> CIDR </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> ) ranges: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --clusterIpSourceWhitelist 192.0.2.0/24,127.0.0.1,::1","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --clusterIpSourceWhitelist 192.0.2.0/24,127.0.0.1,::1</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Ensure <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--clusterIpSourceWhitelist" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --clusterIpSourceWhitelist </code> </span> </a> includes the IP address <em> or </em> CIDR ranges that include the IP address of each replica set member or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> in the deployment to ensure healthy communication between cluster components. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --ipv6 </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--ipv6" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--ipv6"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Enables IPv6 support. <code class="leafygreen-ui-1l06pbn"> mongod </code> disables IPv6 support by default. </p> <p class="leafygreen-ui-1kp3ins"> Setting <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ipv6" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ipv6 </code> </span> </a> does <em> not </em> direct the <code class="leafygreen-ui-1l06pbn"> mongod </code> to listen on any local IPv6 addresses or interfaces. To configure the <code class="leafygreen-ui-1l06pbn"> mongod </code> to listen on an IPv6 interface, you must either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Configure <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--bind_ip" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> </span> </a> with one or more IPv6 addresses or hostnames that resolve to IPv6 addresses, <strong> or </strong> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Set <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--bind_ip_all" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --bind_ip_all </code> </span> </a> to <code class="leafygreen-ui-1l06pbn"> true </code> . </p> </li> </ul> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --listenBacklog &lt;number&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--listenBacklog" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--listenBacklog"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : Target system <code class="leafygreen-ui-1l06pbn"> SOMAXCONN </code> constant </p> <p class="leafygreen-ui-1kp3ins"> The maximum number of connections that can exist in the listen queue. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Consult your local system's documentation to understand the limitations and configuration requirements before using this parameter. </p> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To prevent undefined behavior, specify a value for this parameter between <code class="leafygreen-ui-1l06pbn"> 1 </code> and the local system <code class="leafygreen-ui-1l06pbn"> SOMAXCONN </code> constant. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The default value for the <code class="leafygreen-ui-1l06pbn"> listenBacklog </code> parameter is set at compile time to the target system <code class="leafygreen-ui-1l06pbn"> SOMAXCONN </code> constant. <code class="leafygreen-ui-1l06pbn"> SOMAXCONN </code> is the maximum valid value that is documented for the <em> backlog </em> parameter to the <em> listen </em> system call. </p> <p class="leafygreen-ui-1kp3ins"> Some systems may interpret <code class="leafygreen-ui-1l06pbn"> SOMAXCONN </code> symbolically, and others numerically. The actual <em> listen backlog </em> applied in practice may differ from any numeric interpretation of the <code class="leafygreen-ui-1l06pbn"> SOMAXCONN </code> constant or argument to <code class="leafygreen-ui-1l06pbn"> --listenBacklog </code> , and may also be constrained by system settings like <code class="leafygreen-ui-1l06pbn"> net.core.somaxconn </code> on Linux. </p> <p class="leafygreen-ui-1kp3ins"> Passing a value for the <code class="leafygreen-ui-1l06pbn"> listenBacklog </code> parameter that exceeds the <code class="leafygreen-ui-1l06pbn"> SOMAXCONN </code> constant for the local system is, by the letter of the standards, undefined behavior. Higher values may be silently integer truncated, may be ignored, may cause unexpected resource consumption, or have other adverse consequences. </p> <p class="leafygreen-ui-1kp3ins"> On systems with workloads that exhibit connection spikes, for which it is empirically known that the local system can honor higher values for the <em> backlog </em> parameter than the <code class="leafygreen-ui-1l06pbn"> SOMAXCONN </code> constant, setting the <code class="leafygreen-ui-1l06pbn"> listenBacklog </code> parameter to a higher value may reduce operation latency as observed by the client by reducing the number of connections which are forced into a backoff state. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --maxConns &lt;number&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--maxConns" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--maxConns"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The maximum number of simultaneous connections that <code class="leafygreen-ui-1l06pbn"> mongod </code> accepts. This setting has no effect if it is higher than your operating system's configured maximum connection tracking threshold. </p> <p class="leafygreen-ui-1kp3ins"> Do not assign too low of a value to this option, or you will encounter errors during normal application operation. </p> </dd> </dl> <span class="leafygreen-ui-1qnjd6d" id="std-label-mongod-log-options-section"> </span> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --logpath &lt;path&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--logpath" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--logpath"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Sends all diagnostic logging information to a log file instead of to standard output or to the host's <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-syslog"> syslog </a> system. MongoDB creates the log file at the path you specify. </p> <p class="leafygreen-ui-1kp3ins"> By default, MongoDB moves any existing log file rather than overwriting it. To instead append to the log file, set the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--logappend" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --logappend </code> </span> </a> option. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --syslog </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--syslog" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--syslog"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Sends all logging output to the host's <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-syslog"> syslog </a> system rather than to standard output or to a log file ( <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--logpath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --logpath </code> </span> </a> ). </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--syslog" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --syslog </code> </span> </a> option is not supported on Windows. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> syslog </code> daemon generates timestamps when it logs a message, not when MongoDB issues the message. This can lead to misleading timestamps for log entries, especially when the system is under heavy load. We recommend using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--logpath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --logpath </code> </span> </a> option for production systems to ensure accurate timestamps. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB includes the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-message-components"> component </a> in its log messages to <code class="leafygreen-ui-1l06pbn"> syslog </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"... ACCESS [repl writer worker 5] Unsupported modification to roles collection ..."} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">... ACCESS [repl writer worker 5] Unsupported modification to roles collection ...</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --syslogFacility &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--syslogFacility" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--syslogFacility"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : user </p> <p class="leafygreen-ui-1kp3ins"> Specifies the facility level used when logging messages to syslog. The value you specify must be supported by your operating system's implementation of syslog. To use this option, you must enable the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--syslog" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --syslog </code> </span> </a> option. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --logappend </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--logappend" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--logappend"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Appends new entries to the end of the existing log file when the <code class="leafygreen-ui-1l06pbn"> mongod </code> instance restarts. Without this option, <code class="leafygreen-ui-1l06pbn"> mongod </code> backs up the existing log and create a new file. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --logRotate &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--logRotate" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--logRotate"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : rename </p> <p class="leafygreen-ui-1kp3ins"> Determines the behavior for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/logRotate/#mongodb-dbcommand-dbcmd.logRotate"> <code class="leafygreen-ui-1l06pbn"> logRotate </code> </a> command when rotating the server log and/or the audit log. Specify either <code class="leafygreen-ui-1l06pbn"> rename </code> or <code class="leafygreen-ui-1l06pbn"> reopen </code> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> rename </code> renames the log file. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> reopen </code> closes and reopens the log file following the typical Linux/Unix log rotate behavior. Use <code class="leafygreen-ui-1l06pbn"> reopen </code> when using the Linux/Unix logrotate utility to avoid log loss. </p> <p class="leafygreen-ui-1kp3ins"> If you specify <code class="leafygreen-ui-1l06pbn"> reopen </code> , you must also use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--logappend" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --logappend </code> . </span> </a> </p> </li> </ul> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --timeStampFormat &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--timeStampFormat" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--timeStampFormat"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : iso8601-local </p> <p class="leafygreen-ui-1kp3ins"> The time format for timestamps in log messages. Specify one of the following values: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width: 20%;"/> <col style="width: 40%;"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> iso8601-utc </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Displays timestamps in Coordinated Universal Time (UTC) in the ISO-8601 format. For example, for New York at the start of the Epoch: <code class="leafygreen-ui-1l06pbn"> 1970-01-01T00:00:00.000Z </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> iso8601-local </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Displays timestamps in local time in the ISO-8601 format. For example, for New York at the start of the Epoch: <code class="leafygreen-ui-1l06pbn"> 1969-12-31T19:00:00.000-05:00 </code> </div> </div> </td> </tr> </tbody> </table> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--timeStampFormat" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --timeStampFormat </code> </span> </a> no longer supports <code class="leafygreen-ui-1l06pbn"> ctime </code> . An example of <code class="leafygreen-ui-1l06pbn"> ctime </code> formatted date is: <code class="leafygreen-ui-1l06pbn"> Wed Dec 31 18:17:54.811 </code> . </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --traceExceptions </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--traceExceptions" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--traceExceptions"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> For internal diagnostic use only. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --pidfilepath &lt;path&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--pidfilepath" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--pidfilepath"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies a file location to store the process ID (PID) of the <code class="leafygreen-ui-1l06pbn"> mongod </code> process. The user running the <code class="leafygreen-ui-1l06pbn"> mongod </code> or <code class="leafygreen-ui-1l06pbn"> mongos </code> process must be able to write to this path. If the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--pidfilepath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --pidfilepath </code> </span> </a> option is not specified, the process does not create a PID file. This option is generally only useful in combination with the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--fork" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --fork </code> </span> </a> option. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Linux </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> On Linux, PID file management is generally the responsibility of your distro's init system: usually a service file in the <code class="leafygreen-ui-1l06pbn"> /etc/init.d </code> directory, or a systemd unit file registered with <code class="leafygreen-ui-1l06pbn"> systemctl </code> . Only use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--pidfilepath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --pidfilepath </code> </span> </a> option if you are not using one of these init systems. For more information, please see the respective <a class="leafygreen-ui-tqgtui" href="/docs/manual/installation/#std-label-tutorial-installation"> Installation Guide </a> for your operating system. </p> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> macOS </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> On macOS, PID file management is generally handled by <code class="leafygreen-ui-1l06pbn"> brew </code> . Only use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--pidfilepath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --pidfilepath </code> </span> </a> option if you are not using <code class="leafygreen-ui-1l06pbn"> brew </code> on your macOS system. For more information, please see the respective Installation Guide for your operating system. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --keyFile &lt;file&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--keyFile" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--keyFile"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the path to a key file that stores the shared secret that MongoDB instances use to authenticate to each other in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-sharded-cluster"> sharded cluster </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> . <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--keyFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --keyFile </code> </span> </a> implies <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auth" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auth </code> </span> </a> . See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-inter-process-auth"> Self-Managed Internal/Membership Authentication </a> for more information. </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-internal-auth-keyfile"> Keyfiles for internal membership authentication </a> use YAML format to allow for multiple keys in a keyfile. The YAML format accepts either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A single key string (same as in earlier versions) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A sequence of key strings </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The YAML format is compatible with the existing single-key keyfiles that use the text file format. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --setParameter &lt;options&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--setParameter" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--setParameter"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies one of the MongoDB parameters described in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/"> MongoDB Server Parameters for a Self-Managed Deployment </a> . You can specify multiple <code class="leafygreen-ui-1l06pbn"> setParameter </code> fields. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --nounixsocket </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--nounixsocket" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--nounixsocket"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Disables listening on the UNIX domain socket. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--nounixsocket" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --nounixsocket </code> </span> </a> applies only to Unix-based systems. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> mongod </code> process always listens on the UNIX socket unless one of the following is true: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--nounixsocket" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --nounixsocket </code> </span> </a> is set </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> is not set </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> does not specify <code class="leafygreen-ui-1l06pbn"> localhost </code> or its associated IP address </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> mongod </code> installed from official <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-on-debian/"> .deb </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/install-mongodb-on-red-hat/"> .rpm </a> packages have the <code class="leafygreen-ui-1l06pbn"> bind_ip </code> configuration set to <code class="leafygreen-ui-1l06pbn"> 127.0.0.1 </code> by default. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --unixSocketPrefix &lt;path&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--unixSocketPrefix" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--unixSocketPrefix"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : /tmp </p> <p class="leafygreen-ui-1kp3ins"> The path for the UNIX socket. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--unixSocketPrefix" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --unixSocketPrefix </code> </span> </a> applies only to Unix-based systems. </p> <p class="leafygreen-ui-1kp3ins"> If this option has no value, the <code class="leafygreen-ui-1l06pbn"> mongod </code> process creates a socket with <code class="leafygreen-ui-1l06pbn"> /tmp </code> as a prefix. MongoDB creates and listens on a UNIX socket unless one of the following is true: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.unixDomainSocket.enabled"> <code class="leafygreen-ui-1l06pbn"> net.unixDomainSocket.enabled </code> </a> is <code class="leafygreen-ui-1l06pbn"> false </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--nounixsocket" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --nounixsocket </code> </span> </a> is set </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> is not set </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> does not specify <code class="leafygreen-ui-1l06pbn"> localhost </code> or its associated IP address </p> </li> </ul> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --filePermissions &lt;path&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--filePermissions" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--filePermissions"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : <code class="leafygreen-ui-1l06pbn"> 0700 </code> </p> <p class="leafygreen-ui-1kp3ins"> Sets the permission for the UNIX domain socket file. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--filePermissions" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --filePermissions </code> </span> </a> applies only to Unix-based systems. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --fork </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--fork" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--fork"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Enables a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-daemon"> daemon </a> mode that runs the <code class="leafygreen-ui-1l06pbn"> mongod </code> process in the background. The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--fork" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --fork </code> </span> </a> option is not supported on Windows. </p> <p class="leafygreen-ui-1kp3ins"> By default <code class="leafygreen-ui-1l06pbn"> mongod </code> does not run as a daemon. You run <code class="leafygreen-ui-1l06pbn"> mongod </code> as a daemon by using either <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--fork" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --fork </code> </span> </a> or a controlling process that handles daemonization, such as <code class="leafygreen-ui-1l06pbn"> upstart </code> or <code class="leafygreen-ui-1l06pbn"> systemd </code> . </p> <p class="leafygreen-ui-1kp3ins"> To use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--fork" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --fork </code> </span> </a> , configure log output for the <code class="leafygreen-ui-1l06pbn"> mongod </code> with one of the following: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--logpath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --logpath </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--syslog" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --syslog </code> </span> </a> </p> </li> </ul> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --auth </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--auth" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--auth"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Enables authorization to control user's access to database resources and operations. When authorization is enabled, MongoDB requires all clients to authenticate themselves first in order to determine the access for the client. </p> <p class="leafygreen-ui-1kp3ins"> To configure users, use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> client. If no users exist, the localhost interface has access to the database until you create the first user. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/security/#std-label-security"> Security </a> for more information. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --noauth </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--noauth" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--noauth"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Disables authentication. Currently the default. Exists for future compatibility and clarity. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --transitionToAuth </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--transitionToAuth" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--transitionToAuth"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Allows the <code class="leafygreen-ui-1l06pbn"> mongod </code> to accept and create authenticated and non-authenticated connections to and from other <code class="leafygreen-ui-1l06pbn"> mongod </code> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances in the deployment. Used for performing rolling transition of replica sets or sharded clusters from a no-auth configuration to <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-inter-process-auth"> internal authentication </a> . Requires specifying a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-inter-process-auth"> internal authentication </a> mechanism such as <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--keyFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --keyFile </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> For example, if using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-internal-auth-keyfile"> keyfiles </a> for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-inter-process-auth"> internal authentication </a> , the <code class="leafygreen-ui-1l06pbn"> mongod </code> creates an authenticated connection with any <code class="leafygreen-ui-1l06pbn"> mongod </code> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> in the deployment using a matching keyfile. If the security mechanisms do not match, the <code class="leafygreen-ui-1l06pbn"> mongod </code> utilizes a non-authenticated connection instead. </p> <p class="leafygreen-ui-1kp3ins"> A <code class="leafygreen-ui-1l06pbn"> mongod </code> running with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--transitionToAuth" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --transitionToAuth </code> </span> </a> does not enforce <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/#std-label-authorization"> user access controls </a> . Users may connect to your deployment without any access control checks and perform read, write, and administrative operations. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> A <code class="leafygreen-ui-1l06pbn"> mongod </code> running with <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-inter-process-auth"> internal authentication </a> and <em> without </em> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--transitionToAuth" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --transitionToAuth </code> </span> </a> requires clients to connect using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/#std-label-authorization"> user access controls </a> . Update clients to connect to the <code class="leafygreen-ui-1l06pbn"> mongod </code> using the appropriate <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-users/#std-label-users"> user </a> prior to restarting <code class="leafygreen-ui-1l06pbn"> mongod </code> without <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--transitionToAuth" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --transitionToAuth </code> . </span> </a> </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --sysinfo </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--sysinfo" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--sysinfo"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns diagnostic system information and then exits. The information provides the page size, the number of physical pages, and the number of available physical pages. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --noscripting </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--noscripting" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--noscripting"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Disables the scripting engine. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --notablescan </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--notablescan" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--notablescan"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Forbids operations that require a collection scan. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.notablescan"> <code class="leafygreen-ui-1l06pbn"> notablescan </code> </a> for additional information. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --shutdown </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--shutdown" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--shutdown"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--shutdown" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --shutdown </code> </span> </a> option cleanly and safely terminates the <code class="leafygreen-ui-1l06pbn"> mongod </code> process. When invoking <code class="leafygreen-ui-1l06pbn"> mongod </code> with this option you must set the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--dbpath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> </span> </a> option either directly or by way of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#std-label-configuration-options"> configuration file </a> and the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--config" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --config </code> </span> </a> option. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--shutdown" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --shutdown </code> </span> </a> option is available only on Linux systems. </p> <p class="leafygreen-ui-1kp3ins"> For additional ways to shut down, see also <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-mongodb-processes/#std-label-terminate-mongod-processes"> Stop <code class="leafygreen-ui-1l06pbn"> mongod </code> Processes. </a> </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --redactClientLogData </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--redactClientLogData" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--redactClientLogData"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Available in MongoDB Enterprise only. </em> </p> <p class="leafygreen-ui-1kp3ins"> A <code class="leafygreen-ui-1l06pbn"> mongod </code> running with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--redactClientLogData" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --redactClientLogData </code> </span> </a> redacts any message accompanying a given log event before logging. This prevents the <code class="leafygreen-ui-1l06pbn"> mongod </code> from writing potentially sensitive data stored on the database to the diagnostic log. Metadata such as error or operation codes, line numbers, and source file names are still visible in the logs. </p> <p class="leafygreen-ui-1kp3ins"> Use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--redactClientLogData" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --redactClientLogData </code> </span> </a> in conjunction with <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-encryption-at-rest/"> Encryption at Rest </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-transport-encryption/"> TLS/SSL (Transport Encryption) </a> to assist compliance with regulatory requirements. </p> <p class="leafygreen-ui-1kp3ins"> For example, a MongoDB deployment might store Personally Identifiable Information (PII) in one or more collections. The <code class="leafygreen-ui-1l06pbn"> mongod </code> logs events such as those related to CRUD operations, sharding metadata, etc. It is possible that the <code class="leafygreen-ui-1l06pbn"> mongod </code> may expose PII as a part of these logging operations. A <code class="leafygreen-ui-1l06pbn"> mongod </code> running with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--redactClientLogData" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --redactClientLogData </code> </span> </a> removes any message accompanying these events before being output to the log, effectively removing the PII. </p> <p class="leafygreen-ui-1kp3ins"> Diagnostics on a <code class="leafygreen-ui-1l06pbn"> mongod </code> running with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--redactClientLogData" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --redactClientLogData </code> </span> </a> may be more difficult due to the lack of data related to a log event. See the <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/monitoring/#std-label-monitoring-log-redaction"> process logging </a> manual page for an example of the effect of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--redactClientLogData" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --redactClientLogData </code> </span> </a> on log output. </p> <p class="leafygreen-ui-1kp3ins"> On a running <code class="leafygreen-ui-1l06pbn"> mongod </code> , use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setParameter/#mongodb-dbcommand-dbcmd.setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.redactClientLogData"> <code class="leafygreen-ui-1l06pbn"> redactClientLogData </code> </a> parameter to configure this setting. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --networkMessageCompressors &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--networkMessageCompressors" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--networkMessageCompressors"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : snappy,zstd,zlib </p> <p class="leafygreen-ui-1kp3ins"> Specifies the default compressor(s) to use for communication between this <code class="leafygreen-ui-1l06pbn"> mongod </code> instance and: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> other members of the deployment if the instance is part of a replica set or a sharded cluster </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> drivers that support the <code class="leafygreen-ui-1l06pbn"> OP_COMPRESSED </code> message format. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> MongoDB supports the following compressors: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-snappy"> snappy </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-zlib"> zlib </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-zstd"> zstd </a> </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Both <code class="leafygreen-ui-1l06pbn"> mongod </code> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances default to <code class="leafygreen-ui-1l06pbn"> snappy,zstd,zlib </code> compressors, in that order. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> To disable network compression, set the value to <code class="leafygreen-ui-1l06pbn"> disabled </code> . </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Messages are compressed when both parties enable network compression. Otherwise, messages between the parties are uncompressed. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> If you specify multiple compressors, then the order in which you list the compressors matter as well as the communication initiator. For example, if <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> specifies the following network compressors <code class="leafygreen-ui-1l06pbn"> zlib,snappy </code> and the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> specifies <code class="leafygreen-ui-1l06pbn"> snappy,zlib </code> , messages between <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> uses <code class="leafygreen-ui-1l06pbn"> zlib </code> . </p> <p class="leafygreen-ui-1kp3ins"> If the parties do not share at least one common compressor, messages between the parties are uncompressed. For example, if <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> specifies the network compressor <code class="leafygreen-ui-1l06pbn"> zlib </code> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> specifies <code class="leafygreen-ui-1l06pbn"> snappy </code> , messages between <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> are not compressed. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --timeZoneInfo &lt;path&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--timeZoneInfo" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--timeZoneInfo"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The full path from which to load the time zone database. If this option is not provided, then MongoDB uses its built-in time zone database. </p> <p class="leafygreen-ui-1kp3ins"> The configuration file included with Linux and macOS packages sets the time zone database path to <code class="leafygreen-ui-1l06pbn"> /usr/share/zoneinfo </code> by default. </p> <p class="leafygreen-ui-1kp3ins"> The built-in time zone database is a copy of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.iana.org/time-zones" rel="noopener noreferrer"> <span> Olson/IANA time zone database </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> . It is updated along with MongoDB releases, but the time zone database release cycle differs from the MongoDB release cycle. The most recent release of the time zone database is available on our <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://downloads.mongodb.org/olson_tz_db/timezonedb-latest.zip" rel="noopener noreferrer"> <span> download site </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"wget https://downloads.mongodb.org/olson_tz_db/timezonedb-latest.zip\nunzip timezonedb-latest.zip\nmongod --timeZoneInfo timezonedb-2017b/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">wget https://downloads.mongodb.org/olson_tz_db/timezonedb-latest.zip</td></tr><tr class=""><td class="leafygreen-ui-7razhx">unzip timezonedb-latest.zip</td></tr><tr class=""><td class="leafygreen-ui-7razhx">mongod --timeZoneInfo timezonedb-2017b/</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB uses the third party <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://github.com/derickr/timelib" rel="noopener noreferrer"> <span> timelib </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> library to provide accurate conversions between timezones. Due to a recent update, <code class="leafygreen-ui-1l06pbn"> timelib </code> could create inaccurate time zone conversions in older versions of MongoDB. </p> <p class="leafygreen-ui-1kp3ins"> To explicitly link to the time zone database in versions of MongoDB prior to 5.0, download the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://downloads.mongodb.org/olson_tz_db/timezonedb-latest.zip" rel="noopener noreferrer"> <span> time zone database </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> . and use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--timeZoneInfo" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> timeZoneInfo </code> </span> </a> parameter. </p> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-processManagement.timeZoneInfo"> <code class="leafygreen-ui-1l06pbn"> processManagement.timeZoneInfo </code> . </a> </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --outputConfig </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--outputConfig" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--outputConfig"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Outputs the <code class="leafygreen-ui-1l06pbn"> mongod </code> instance's configuration options, formatted in YAML, to <code class="leafygreen-ui-1l06pbn"> stdout </code> and exits the <code class="leafygreen-ui-1l06pbn"> mongod </code> instance. For configuration options that uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/expansion-directives/#std-label-externally-sourced-values"> Externally Sourced Configuration File Values for Self-Managed Deployments </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--outputConfig" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --outputConfig </code> </span> </a> returns the resolved value for those options. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This may include any configured passwords or secrets previously obfuscated through the external source. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For usage examples, see: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/expansion-directives/#std-label-expansion-directive-output"> Output the Configuration File with Resolved Expansion Directive Values </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/convert-command-line-options-to-yaml/"> Convert Self-Managed Command-Line Options to YAML </a> </p> </li> </ul> </dd> </dl> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> LDAP Authentication or Authorization Options <a class="headerlink leafygreen-ui-1kepx47" href="#ldap-authentication-or-authorization-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="ldap-authentication-or-authorization-options"> </div> </a> </h3> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, LDAP authentication and authorization is deprecated. LDAP is available and will continue to operate without changes throughout the lifetime of MongoDB 8. LDAP will be removed in a future major release. </p> <p class="leafygreen-ui-1kp3ins"> For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/LDAP-deprecation/#std-label-ldap-deprecation"> LDAP Deprecation. </a> </p> </div> </div> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --ldapServers &lt;host1&gt;:&lt;port&gt;,&lt;host2&gt;:&lt;port&gt;,...,&lt;hostN&gt;:&lt;port&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--ldapServers" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--ldapServers"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Available in MongoDB Enterprise only. </em> </p> <p class="leafygreen-ui-1kp3ins"> The LDAP server against which the <code class="leafygreen-ui-1l06pbn"> mongod </code> authenticates users or determines what actions a user is authorized to perform on a given database. If the LDAP server specified has any replicated instances, you may specify the host and port of each replicated server in a comma-delimited list. </p> <p class="leafygreen-ui-1kp3ins"> If your LDAP infrastructure partitions the LDAP directory over multiple LDAP servers, specify <em> one </em> LDAP server or any of its replicated instances to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapServers" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapServers </code> </span> </a> . MongoDB supports following LDAP referrals as defined in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.rfc-editor.org/rfc/rfc4511.txt" rel="noopener noreferrer"> <span> RFC 4511 4.1.10 </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> . Do not use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapServers" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapServers </code> </span> </a> for listing every LDAP server in your infrastructure. </p> <p class="leafygreen-ui-1kp3ins"> This setting can be configured on a running <code class="leafygreen-ui-1l06pbn"> mongod </code> using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setParameter/#mongodb-dbcommand-dbcmd.setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If unset, <code class="leafygreen-ui-1l06pbn"> mongod </code> cannot use <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-ldap/"> LDAP authentication or authorization. </a> </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --ldapValidateLDAPServerConfig &lt;boolean&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--ldapValidateLDAPServerConfig" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--ldapValidateLDAPServerConfig"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Available in MongoDB Enterprise </em> </p> <p class="leafygreen-ui-1kp3ins"> A flag that determines if the <code class="leafygreen-ui-1l06pbn"> mongod </code> instance checks the availability of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapServers" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> LDAP server(s) </code> </span> </a> as part of its startup: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> true </code> , the <code class="leafygreen-ui-1l06pbn"> mongod </code> instance performs the availability check and only continues to start up if the LDAP server is available. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> false </code> , the <code class="leafygreen-ui-1l06pbn"> mongod </code> instance skips the availability check; i.e. the instance starts up even if the LDAP server is unavailable. </p> </li> </ul> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --ldapQueryUser &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--ldapQueryUser" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--ldapQueryUser"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Available in MongoDB Enterprise only. </em> </p> <p class="leafygreen-ui-1kp3ins"> The identity with which <code class="leafygreen-ui-1l06pbn"> mongod </code> binds as, when connecting to or performing queries on an LDAP server. </p> <p class="leafygreen-ui-1kp3ins"> Only required if any of the following are true: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-ldap-external/#std-label-security-ldap-external"> LDAP authorization. </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Using an LDAP query for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapUserToDNMapping" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> username transformation </code> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The LDAP server disallows anonymous binds </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> You must use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryUser </code> </span> </a> with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryPassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryPassword </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> If unset, <code class="leafygreen-ui-1l06pbn"> mongod </code> doesn't attempt to bind to the LDAP server. </p> <p class="leafygreen-ui-1kp3ins"> This setting can be configured on a running <code class="leafygreen-ui-1l06pbn"> mongod </code> using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setParameter/#mongodb-dbcommand-dbcmd.setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> . </a> </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Windows MongoDB deployments can use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapBindWithOSDefaults" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapBindWithOSDefaults </code> </span> </a> instead of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryUser </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryPassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryPassword </code> </span> </a> . You cannot specify both <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryUser </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapBindWithOSDefaults" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapBindWithOSDefaults </code> </span> </a> at the same time. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --ldapQueryPassword &lt;string | array&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--ldapQueryPassword" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--ldapQueryPassword"> </div> </a> </dt> <dd> </dd> </dl> <p class="leafygreen-ui-1kp3ins"> <em> Available in MongoDB Enterprise only. </em> </p> <p class="leafygreen-ui-1kp3ins"> The password used to bind to an LDAP server when using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryUser </code> </span> </a> . You must use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryPassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryPassword </code> </span> </a> with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryUser </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> If not set, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-program-mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> does not attempt to bind to the LDAP server. </p> <p class="leafygreen-ui-1kp3ins"> You can configure this setting on a running <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-program-mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setParameter/#mongodb-dbcommand-dbcmd.setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> ldapQueryPassword </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setParameter/#mongodb-dbcommand-dbcmd.setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> command accepts either a string or an array of strings. If <code class="leafygreen-ui-1l06pbn"> ldapQueryPassword </code> is set to an array, MongoDB tries each password in order until one succeeds. Use a password array to roll over the LDAP account password without downtime. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Windows MongoDB deployments can use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapBindWithOSDefaults" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapBindWithOSDefaults </code> </span> </a> instead of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryUser </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryPassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryPassword </code> </span> </a> . You cannot specify both <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryPassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryPassword </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapBindWithOSDefaults" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapBindWithOSDefaults </code> </span> </a> at the same time. </p> </div> </div> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --ldapBindWithOSDefaults &lt;bool&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--ldapBindWithOSDefaults" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--ldapBindWithOSDefaults"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : false </p> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise for the Windows platform only. </p> <p class="leafygreen-ui-1kp3ins"> Allows <code class="leafygreen-ui-1l06pbn"> mongod </code> to authenticate, or bind, using your Windows login credentials when connecting to the LDAP server. </p> <p class="leafygreen-ui-1kp3ins"> Only required if: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-ldap-external/#std-label-security-ldap-external"> LDAP authorization. </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Using an LDAP query for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapUserToDNMapping" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> username transformation </code> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The LDAP server disallows anonymous binds </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapBindWithOSDefaults" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapBindWithOSDefaults </code> </span> </a> to replace <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryUser </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryPassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryPassword </code> . </span> </a> </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --ldapBindMethod &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--ldapBindMethod" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--ldapBindMethod"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : simple </p> <p class="leafygreen-ui-1kp3ins"> <em> Available in MongoDB Enterprise only. </em> </p> <p class="leafygreen-ui-1kp3ins"> The method <code class="leafygreen-ui-1l06pbn"> mongod </code> uses to authenticate to an LDAP server. Use with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryUser" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryUser </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapQueryPassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapQueryPassword </code> </span> </a> to connect to the LDAP server. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapBindMethod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapBindMethod </code> </span> </a> supports the following values: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> simple </code> - <code class="leafygreen-ui-1l06pbn"> mongod </code> uses simple authentication. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sasl </code> - <code class="leafygreen-ui-1l06pbn"> mongod </code> uses SASL protocol for authentication </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If you specify <code class="leafygreen-ui-1l06pbn"> sasl </code> , you can configure the available SASL mechanisms using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapBindSaslMechanisms" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapBindSaslMechanisms </code> </span> </a> . <code class="leafygreen-ui-1l06pbn"> mongod </code> defaults to using <code class="leafygreen-ui-1l06pbn"> DIGEST-MD5 </code> mechanism. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --ldapBindSaslMechanisms &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--ldapBindSaslMechanisms" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--ldapBindSaslMechanisms"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : DIGEST-MD5 </p> <p class="leafygreen-ui-1kp3ins"> <em> Available in MongoDB Enterprise only. </em> </p> <p class="leafygreen-ui-1kp3ins"> A comma-separated list of SASL mechanisms <code class="leafygreen-ui-1l06pbn"> mongod </code> can use when authenticating to the LDAP server. The <code class="leafygreen-ui-1l06pbn"> mongod </code> and the LDAP server must agree on at least one mechanism. The <code class="leafygreen-ui-1l06pbn"> mongod </code> dynamically loads any SASL mechanism libraries installed on the host machine at runtime. </p> <p class="leafygreen-ui-1kp3ins"> Install and configure the appropriate libraries for the selected SASL mechanism(s) on both the <code class="leafygreen-ui-1l06pbn"> mongod </code> host and the remote LDAP server host. Your operating system may include certain SASL libraries by default. Defer to the documentation associated with each SASL mechanism for guidance on installation and configuration. </p> <p class="leafygreen-ui-1kp3ins"> If using the <code class="leafygreen-ui-1l06pbn"> GSSAPI </code> SASL mechanism for use with <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/kerberos/#std-label-security-kerberos"> Kerberos Authentication on Self-Managed Deployments </a> , verify the following for the <code class="leafygreen-ui-1l06pbn"> mongod </code> host machine: </p> <dl> <dt> <code class="leafygreen-ui-1l06pbn"> Linux </code> </dt> <dd class="css-1ufxuu7"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> KRB5_CLIENT_KTNAME </code> environment variable resolves to the name of the client <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/kerberos/#std-label-keytab-files"> Linux Keytab Files </a> for the host machine. For more on Kerberos environment variables, please defer to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://web.mit.edu/kerberos/krb5-1.13/doc/admin/env_variables.html" rel="noopener noreferrer"> <span> Kerberos documentation. </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The client keytab includes a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/kerberos/#std-label-kerberos-user-principal"> User Principal </a> for the <code class="leafygreen-ui-1l06pbn"> mongod </code> to use when connecting to the LDAP server and execute LDAP queries. </p> </li> </ul> </dd> <dt> <code class="leafygreen-ui-1l06pbn"> Windows </code> </dt> <dd class="css-1ufxuu7"> If connecting to an Active Directory server, the Windows Kerberos configuration automatically generates a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa380510(v=vs.85).aspx" rel="noopener noreferrer"> <span> Ticket-Granting-Ticket </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> when the user logs onto the system. Set <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapBindWithOSDefaults" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapBindWithOSDefaults </code> </span> </a> to <code class="leafygreen-ui-1l06pbn"> true </code> to allow <code class="leafygreen-ui-1l06pbn"> mongod </code> to use the generated credentials when connecting to the Active Directory server and execute queries. </dd> </dl> <p class="leafygreen-ui-1kp3ins"> Set <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapBindMethod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapBindMethod </code> </span> </a> to <code class="leafygreen-ui-1l06pbn"> sasl </code> to use this option. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For a complete list of SASL mechanisms see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml" rel="noopener noreferrer"> <span> IANA listing </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> . Defer to the documentation for your LDAP or Active Directory service for identifying the SASL mechanisms compatible with the service. </p> <p class="leafygreen-ui-1kp3ins"> MongoDB is not a source of SASL mechanism libraries, nor is the MongoDB documentation a definitive source for installing or configuring any given SASL mechanism. For documentation and support, defer to the SASL mechanism library vendor or owner. </p> <p class="leafygreen-ui-1kp3ins"> For more information on SASL, defer to the following resources: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For Linux, please see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.cyrusimap.org/sasl/" rel="noopener noreferrer"> <span> Cyrus SASL documentation. </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For Windows, please see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://msdn.microsoft.com/en-us/library/cc223500.aspx" rel="noopener noreferrer"> <span> Windows SASL documentation. </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> </li> </ul> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --ldapTransportSecurity &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--ldapTransportSecurity" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--ldapTransportSecurity"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : tls </p> <p class="leafygreen-ui-1kp3ins"> <em> Available in MongoDB Enterprise only. </em> </p> <p class="leafygreen-ui-1kp3ins"> By default, <code class="leafygreen-ui-1l06pbn"> mongod </code> creates a TLS/SSL secured connection to the LDAP server. </p> <p class="leafygreen-ui-1kp3ins"> For Linux deployments, you must configure the appropriate TLS Options in <code class="leafygreen-ui-1l06pbn"> /etc/openldap/ldap.conf </code> file. Your operating system's package manager creates this file as part of the MongoDB Enterprise installation, via the <code class="leafygreen-ui-1l06pbn"> libldap </code> dependency. See the documentation for <code class="leafygreen-ui-1l06pbn"> TLS Options </code> in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.openldap.org/software/man.cgi?query=ldap.conf&amp;manpath=OpenLDAP+2.4-Release" rel="noopener noreferrer"> <span> ldap.conf OpenLDAP documentation </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> for more complete instructions. </p> <p class="leafygreen-ui-1kp3ins"> For Windows deployment, you must add the LDAP server CA certificates to the Windows certificate management tool. The exact name and functionality of the tool may vary depending on operating system version. Please see the documentation for your version of Windows for more information on certificate management. </p> <p class="leafygreen-ui-1kp3ins"> Set <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapTransportSecurity" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapTransportSecurity </code> </span> </a> to <code class="leafygreen-ui-1l06pbn"> none </code> to disable TLS/SSL between <code class="leafygreen-ui-1l06pbn"> mongod </code> and the LDAP server. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Setting <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapTransportSecurity" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapTransportSecurity </code> </span> </a> to <code class="leafygreen-ui-1l06pbn"> none </code> transmits plaintext information and possibly credentials between <code class="leafygreen-ui-1l06pbn"> mongod </code> and the LDAP server. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --ldapTimeoutMS &lt;int&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--ldapTimeoutMS" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--ldapTimeoutMS"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : 10000 </p> <p class="leafygreen-ui-1kp3ins"> <em> Available in MongoDB Enterprise only. </em> </p> <p class="leafygreen-ui-1kp3ins"> The amount of time in milliseconds <code class="leafygreen-ui-1l06pbn"> mongod </code> should wait for an LDAP server to respond to a request. </p> <p class="leafygreen-ui-1kp3ins"> Increasing the value of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapTimeoutMS" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapTimeoutMS </code> </span> </a> may prevent connection failure between the MongoDB server and the LDAP server, if the source of the failure is a connection timeout. Decreasing the value of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapTimeoutMS" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapTimeoutMS </code> </span> </a> reduces the time MongoDB waits for a response from the LDAP server. </p> <p class="leafygreen-ui-1kp3ins"> This setting can be configured on a running <code class="leafygreen-ui-1l06pbn"> mongod </code> using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setParameter/#mongodb-dbcommand-dbcmd.setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> . </a> </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --ldapRetryCount &lt;int&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--ldapRetryCount" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--ldapRetryCount"> </div> </a> </dt> <dd> <div> <p> <em> New in version 6.1 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : 0 </p> <p class="leafygreen-ui-1kp3ins"> <em> Available in MongoDB Enterprise only. </em> </p> <p class="leafygreen-ui-1kp3ins"> Number of operation retries by the server LDAP manager after a network error. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --ldapUserToDNMapping &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--ldapUserToDNMapping" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--ldapUserToDNMapping"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Available in MongoDB Enterprise only. </em> </p> <p class="leafygreen-ui-1kp3ins"> Maps the username provided to <code class="leafygreen-ui-1l06pbn"> mongod </code> for authentication to a LDAP Distinguished Name (DN). You may need to use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapUserToDNMapping" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapUserToDNMapping </code> </span> </a> to transform a username into an LDAP DN in the following scenarios: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Performing LDAP authentication with simple LDAP binding, where users authenticate to MongoDB with usernames that are not full LDAP DNs. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Using an <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapAuthzQueryTemplate" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> LDAP authorization query template </code> </span> </a> that requires a DN. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Transforming the usernames of clients authenticating to Mongo DB using different authentication mechanisms, such as x.509 or kerberos, to a full LDAP DN for authorization. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapUserToDNMapping" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapUserToDNMapping </code> </span> </a> expects a quote-enclosed JSON-string representing an ordered array of documents. Each document contains a regular expression <code class="leafygreen-ui-1l06pbn"> match </code> and either a <code class="leafygreen-ui-1l06pbn"> substitution </code> or <code class="leafygreen-ui-1l06pbn"> ldapQuery </code> template used for transforming the incoming username. </p> <p class="leafygreen-ui-1kp3ins"> Each document in the array has the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n match: \"&lt;regex&gt;\"\n substitution: \"&lt;ldap&gt;\" | ldapQuery: \"&lt;ldap&gt;\"\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">match</span>: <span class="lg-highlight-string">"&lt;regex&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">substitution</span>: <span class="lg-highlight-string">"&lt;LDAP DN&gt;"</span> | <span class="lg-highlight-attr">ldapQuery</span>: <span class="lg-highlight-string">"&lt;LDAP Query&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width: 10%;"/> <col style="width: 70%;"/> <col style="width: 20%;"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> match </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An ECMAScript-formatted regular expression (regex) to match against a provided username. Each parenthesis-enclosed section represents a regex capture group used by <code class="leafygreen-ui-1l06pbn"> substitution </code> or <code class="leafygreen-ui-1l06pbn"> ldapQuery </code> . </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> "(.+)ENGINEERING" </code> <code class="leafygreen-ui-1l06pbn"> "(.+)DBA" </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> substitution </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> An LDAP distinguished name (DN) formatting template that converts the authentication name matched by the <code class="leafygreen-ui-1l06pbn"> match </code> regex into a LDAP DN. Each curly bracket-enclosed numeric value is replaced by the corresponding <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.regular-expressions.info/refcapture.html" rel="noopener noreferrer"> <span> regex capture group </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> extracted from the authentication username via the <code class="leafygreen-ui-1l06pbn"> match </code> regex. </p> <p class="leafygreen-ui-1kp3ins"> The result of the substitution must be an <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.ietf.org/rfc/rfc4514.txt" rel="noopener noreferrer"> <span> RFC4514 </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> escaped string. </p> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> "cn={0},ou=engineering, dc=example,dc=com" </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> ldapQuery </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> A LDAP query formatting template that inserts the authentication name matched by the <code class="leafygreen-ui-1l06pbn"> match </code> regex into an LDAP query URI encoded respecting RFC4515 and RFC4516. Each curly bracket-enclosed numeric value is replaced by the corresponding <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.regular-expressions.info/refcapture.html" rel="noopener noreferrer"> <span> regex capture group </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> extracted from the authentication username via the <code class="leafygreen-ui-1l06pbn"> match </code> expression. <code class="leafygreen-ui-1l06pbn"> mongod </code> executes the query against the LDAP server to retrieve the LDAP DN for the authenticated user. <code class="leafygreen-ui-1l06pbn"> mongod </code> requires exactly one returned result for the transformation to be successful, or <code class="leafygreen-ui-1l06pbn"> mongod </code> skips this transformation. </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> "ou=engineering,dc=example, dc=com??one?(user={0})" </code> </div> </div> </td> </tr> </tbody> </table> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> An explanation of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.ietf.org/rfc/rfc4514.txt" rel="noopener noreferrer"> <span> RFC4514 </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc4515" rel="noopener noreferrer"> <span> RFC4515 </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc4516" rel="noopener noreferrer"> <span> RFC4516 </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> , or LDAP queries is out of scope for the MongoDB Documentation. Please review the RFC directly or use your preferred LDAP resource. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For each document in the array, you must use either <code class="leafygreen-ui-1l06pbn"> substitution </code> or <code class="leafygreen-ui-1l06pbn"> ldapQuery </code> . You <em> cannot </em> specify both in the same document. </p> <p class="leafygreen-ui-1kp3ins"> When performing authentication or authorization, <code class="leafygreen-ui-1l06pbn"> mongod </code> steps through each document in the array in the given order, checking the authentication username against the <code class="leafygreen-ui-1l06pbn"> match </code> filter. If a match is found, <code class="leafygreen-ui-1l06pbn"> mongod </code> applies the transformation and uses the output for authenticating the user. <code class="leafygreen-ui-1l06pbn"> mongod </code> does not check the remaining documents in the array. </p> <p class="leafygreen-ui-1kp3ins"> If the given document does not match the provided authentication name, <code class="leafygreen-ui-1l06pbn"> mongod </code> continues through the list of documents to find additional matches. If no matches are found in any document, or the transformation the document describes fails, <code class="leafygreen-ui-1l06pbn"> mongod </code> returns an error. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> mongod </code> also returns an error if one of the transformations cannot be evaluated due to networking or authentication failures to the LDAP server. <code class="leafygreen-ui-1l06pbn"> mongod </code> rejects the connection request and does not check the remaining documents in the array. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapUserToDNMapping" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapUserToDNMapping </code> </span> </a> accepts an empty string <code class="leafygreen-ui-1l06pbn"> "" </code> or empty array <code class="leafygreen-ui-1l06pbn"> [ ] </code> in place of a mapping documnent. If providing an empty string or empty array to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapUserToDNMapping" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapUserToDNMapping </code> </span> </a> , MongoDB maps the authenticated username as the LDAP DN. In earlier versions, providing an empty mapping document causes mapping to fail. </p> <div class="leafygreen-ui-vg7qwp" role="note"> <h2 class="leafygreen-ui-2xicti"> Example </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The following shows two transformation documents. The first document matches against any string ending in <code class="leafygreen-ui-1l06pbn"> @ENGINEERING </code> , placing anything preceeding the suffix into a regex capture group. The second document matches against any string ending in <code class="leafygreen-ui-1l06pbn"> @DBA </code> , placing anything preceeding the suffix into a regex capture group. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> You must pass the array to --ldapUserToDNMapping as a string. </strong> </h3> <div class="leafygreen-ui-9mycqc"> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"[\n {\n match: \"(.+)@ENGINEERING.EXAMPLE.COM\",\n substitution: \"cn={0},ou=engineering,dc=example,dc=com\"\n },\n {\n match: \"(.+)@DBA.EXAMPLE.COM\",\n ldapQuery: \"ou=dba,dc=example,dc=com??one?(user={0})\"\n\n }\n\n]\""} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">"[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> match: "(.+)@ENGINEERING.EXAMPLE.COM",</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> substitution: "cn={0},ou=engineering,dc=example,dc=com"</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> match: "(.+)@DBA.EXAMPLE.COM",</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ldapQuery: "ou=dba,dc=example,dc=com??one?(user={0})"</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">]"</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> A user with username <code class="leafygreen-ui-1l06pbn"> [email protected] </code> matches the first document. The regex capture group <code class="leafygreen-ui-1l06pbn"> {0} </code> corresponds to the string <code class="leafygreen-ui-1l06pbn"> alice </code> . The resulting output is the DN <code class="leafygreen-ui-1l06pbn"> "cn=alice,ou=engineering,dc=example,dc=com" </code> . </p> <p class="leafygreen-ui-1kp3ins"> A user with username <code class="leafygreen-ui-1l06pbn"> [email protected] </code> matches the second document. The regex capture group <code class="leafygreen-ui-1l06pbn"> {0} </code> corresponds to the string <code class="leafygreen-ui-1l06pbn"> bob </code> . The resulting output is the LDAP query <code class="leafygreen-ui-1l06pbn"> "ou=dba,dc=example,dc=com??one?(user=bob)" </code> . <code class="leafygreen-ui-1l06pbn"> mongod </code> executes this query against the LDAP server, returning the result <code class="leafygreen-ui-1l06pbn"> "cn=bob,ou=dba,dc=example,dc=com" </code> . </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> If <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapUserToDNMapping" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapUserToDNMapping </code> </span> </a> is unset, <code class="leafygreen-ui-1l06pbn"> mongod </code> applies no transformations to the username when attempting to authenticate or authorize a user against the LDAP server. </p> <p class="leafygreen-ui-1kp3ins"> This setting can be configured on a running <code class="leafygreen-ui-1l06pbn"> mongod </code> using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setParameter/#mongodb-dbcommand-dbcmd.setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> database command. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --ldapAuthzQueryTemplate &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--ldapAuthzQueryTemplate" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--ldapAuthzQueryTemplate"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Available in MongoDB Enterprise only. </em> </p> <p class="leafygreen-ui-1kp3ins"> A relative LDAP query URL formatted conforming to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc4515" rel="noopener noreferrer"> <span> RFC4515 </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc4516" rel="noopener noreferrer"> <span> RFC4516 </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> that <code class="leafygreen-ui-1l06pbn"> mongod </code> executes to obtain the LDAP groups to which the authenticated user belongs to. The query is relative to the host or hosts specified in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapServers" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --ldapServers </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> In the URL, you can use the following substituion tokens: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width: 20%;"/> <col style="width: 80%;"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Substitution Token </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {USER} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Substitutes the authenticated username, or the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.userToDNMapping"> <code class="leafygreen-ui-1l06pbn"> transformed </code> </a> username if a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--ldapUserToDNMapping" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> username mapping </code> </span> </a> is specified. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> {PROVIDED_USER} </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Substitutes the supplied username, i.e. before either authentication or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.ldap.userToDNMapping"> <code class="leafygreen-ui-1l06pbn"> LDAP transformation </code> . </a> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> When constructing the query URL, ensure that the order of LDAP parameters respects RFC4516: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[ dn [ ? [attributes] [ ? [scope] [ ? [filter] [ ? [Extensions] ] ] ] ] ]","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ dn [ ? [attributes] [ ? [scope] [ ? [filter] [ ? [Extensions] ] ] ] ] ]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If your query includes an attribute, <code class="leafygreen-ui-1l06pbn"> mongod </code> assumes that the query retrieves a the DNs which this entity is member of. </p> <p class="leafygreen-ui-1kp3ins"> If your query does not include an attribute, <code class="leafygreen-ui-1l06pbn"> mongod </code> assumes the query retrieves all entities which the user is member of. </p> <p class="leafygreen-ui-1kp3ins"> For each LDAP DN returned by the query, <code class="leafygreen-ui-1l06pbn"> mongod </code> assigns the authorized user a corresponding role on the <code class="leafygreen-ui-1l06pbn"> admin </code> database. If a role on the on the <code class="leafygreen-ui-1l06pbn"> admin </code> database exactly matches the DN, <code class="leafygreen-ui-1l06pbn"> mongod </code> grants the user the roles and privileges assigned to that role. See the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createRole/#mongodb-method-db.createRole"> <code class="leafygreen-ui-1l06pbn"> db.createRole() </code> </a> method for more information on creating roles. </p> <div class="leafygreen-ui-vg7qwp" role="note"> <h2 class="leafygreen-ui-2xicti"> Example </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This LDAP query returns any groups listed in the LDAP user object's <code class="leafygreen-ui-1l06pbn"> memberOf </code> attribute. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"\"{USER}?memberOf?base\"","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-string">"{USER}?memberOf?base"</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Your LDAP configuration may not include the <code class="leafygreen-ui-1l06pbn"> memberOf </code> attribute as part of the user schema, may possess a different attribute for reporting group membership, or may not track group membership through attributes. Configure your query with respect to your own unique LDAP configuration. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> If unset, <code class="leafygreen-ui-1l06pbn"> mongod </code> cannot authorize users using LDAP. </p> <p class="leafygreen-ui-1kp3ins"> This setting can be configured on a running <code class="leafygreen-ui-1l06pbn"> mongod </code> using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setParameter/#mongodb-dbcommand-dbcmd.setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> database command. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> An explanation of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc4515" rel="noopener noreferrer"> <span> RFC4515 </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc4516" rel="noopener noreferrer"> <span> RFC4516 </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> or LDAP queries is out of scope for the MongoDB Documentation. Please review the RFC directly or use your preferred LDAP resource. </p> </div> </div> </dd> </dl> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Storage Options <a class="headerlink leafygreen-ui-1kepx47" href="#storage-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="storage-options"> </div> </a> </h3> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --storageEngine string </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--storageEngine" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--storageEngine"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : <code class="leafygreen-ui-1l06pbn"> wiredTiger </code> </p> <p class="leafygreen-ui-1kp3ins"> Specifies the storage engine for the <code class="leafygreen-ui-1l06pbn"> mongod </code> database. Available values include: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width: 20%;"/> <col style="width: 80%;"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> wiredTiger </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> To specify the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/wiredtiger/"> WiredTiger Storage Engine. </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> inMemory </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> To specify the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/inmemory/"> In-Memory Storage Engine for Self-Managed Deployments. </a> </p> <p class="leafygreen-ui-1kp3ins"> <em> Available in MongoDB Enterprise only. </em> </p> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> If you attempt to start a <code class="leafygreen-ui-1l06pbn"> mongod </code> with a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--dbpath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> </span> </a> that contains data files produced by a storage engine other than the one specified by <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--storageEngine" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --storageEngine </code> </span> </a> , <code class="leafygreen-ui-1l06pbn"> mongod </code> doesn't start. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --dbpath &lt;path&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--dbpath" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--dbpath"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : <code class="leafygreen-ui-1l06pbn"> /data/db </code> on Linux and macOS, <code class="leafygreen-ui-1l06pbn"> \data\db </code> on Windows </p> <p class="leafygreen-ui-1kp3ins"> The directory where the <code class="leafygreen-ui-1l06pbn"> mongod </code> instance stores its data. </p> <p class="leafygreen-ui-1kp3ins"> If using the default <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#std-label-configuration-options"> Configuration File </a> included with a package manager installation of MongoDB, the corresponding <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> storage.dbPath </code> </a> setting uses a different default. </p> <p class="leafygreen-ui-1kp3ins"> The files in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--dbpath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> </span> </a> must correspond to the storage engine specified in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--storageEngine" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --storageEngine </code> </span> </a> . If the data files do not correspond to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--storageEngine" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --storageEngine </code> </span> </a> , <code class="leafygreen-ui-1l06pbn"> mongod </code> doesn't start. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --directoryperdb </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--directoryperdb" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--directoryperdb"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Uses a separate directory to store data for each database. The directories are under the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--dbpath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> </span> </a> directory, and each subdirectory name corresponds to the database name. </p> <p class="leafygreen-ui-1kp3ins"> Not available for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> instances that use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/inmemory/#std-label-storage-inmemory"> in-memory storage engine. </a> </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, dropping the final collection in a database (or dropping the database itself) when <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--directoryperdb" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --directoryperdb </code> </span> </a> is enabled deletes the newly empty subdirectory for that database. </p> <p class="leafygreen-ui-1kp3ins"> To change the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--directoryperdb" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --directoryperdb </code> </span> </a> option for existing deployments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For standalone instances: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongodump/#mongodb-binary-bin.mongodump" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongodump </code> </span> </a> on the existing <code class="leafygreen-ui-1l06pbn"> mongod </code> instance to generate a backup. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Stop the <code class="leafygreen-ui-1l06pbn"> mongod </code> instance. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Add the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--directoryperdb" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --directoryperdb </code> </span> </a> value <strong> and </strong> configure a new data directory </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Restart the <code class="leafygreen-ui-1l06pbn"> mongod </code> instance. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongorestore/#mongodb-binary-bin.mongorestore" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongorestore </code> </span> </a> to populate the new data directory. </p> </li> </ol> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For replica sets: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Stop a secondary member. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Add the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--directoryperdb" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --directoryperdb </code> </span> </a> value <strong> and </strong> configure a new data directory to that secondary member. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Restart that secondary. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-sync/#std-label-replica-set-initial-sync"> initial sync </a> to populate the new data directory. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Update remaining secondaries in the same fashion. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Step down the primary, and update the stepped-down member in the same fashion. </p> </li> </ol> </li> </ul> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --syncdelay &lt;value&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--syncdelay" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--syncdelay"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : 60 </p> <p class="leafygreen-ui-1kp3ins"> Controls how much time can pass before MongoDB flushes data to the data files. </p> <p class="leafygreen-ui-1kp3ins"> <strong> Do not set this value on production systems. </strong> In almost every situation, you should use the default setting. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> mongod </code> process writes data very quickly to the journal and lazily to the data files. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--syncdelay" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --syncdelay </code> </span> </a> has no effect on <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/journaling/#std-label-journaling-internals"> journaling </a> , but if <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--syncdelay" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --syncdelay </code> </span> </a> is set to <code class="leafygreen-ui-1l06pbn"> 0 </code> the journal eventually consumes all available disk space. </p> <p class="leafygreen-ui-1kp3ins"> Not available for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> instances that use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/inmemory/#std-label-storage-inmemory"> in-memory storage engine. </a> </p> <p class="leafygreen-ui-1kp3ins"> To provide <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-durable"> durable </a> data, <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/wiredtiger/#std-label-storage-wiredtiger"> WiredTiger </a> uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/wiredtiger/#std-label-storage-wiredtiger-checkpoints"> checkpoints </a> . For more details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/journaling/#std-label-journaling-wiredTiger"> Journaling and the WiredTiger Storage Engine. </a> </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --upgrade </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--upgrade" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--upgrade"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Upgrades the on-disk data format of the files specified by the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--dbpath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> </span> </a> to the latest version, if needed. </p> <p class="leafygreen-ui-1kp3ins"> This option only affects the operation of the <code class="leafygreen-ui-1l06pbn"> mongod </code> if the data files are in an old format. </p> <p class="leafygreen-ui-1kp3ins"> In most cases you should not set this value, so you can exercise the most control over your upgrade process. See the MongoDB release notes for more information about the upgrade process. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --repair </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--repair" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--repair"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Runs a repair routine on all databases for a <code class="leafygreen-ui-1l06pbn"> mongod </code> instance. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The repair operation validates the collections to find any inconsistencies and fixes them if possible, which avoids rebuilding the indexes. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If a collection's data file is salvaged or if the collection has inconsistencies that the validate step is unable to fix, then all indexes are rebuilt. </p> </li> </ul> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If you are running with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-journal"> journaling </a> enabled, there is almost never any need to run repair since the server can use the journal files to restore the data files to a clean state automatically. However, you may need to run repair in cases where you need to recover from a disk-level data corruption. </p> </div> </div> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Only use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--repair" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod --repair </code> </span> </a> if you have no other options. The operation removes and does not save any corrupt data during the repair process. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Avoid running <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--repair" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --repair </code> </span> </a> against a replica set member: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To repair a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> member, if you have an intact copy of your data available (e.g. a recent backup or an intact member of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> ), restore from that intact copy instead. To learn more, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/resync-replica-set-member/#std-label-resync-replica-member"> Resync a Member of a Self-Managed Replica Set. </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you choose to run <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--repair" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod --repair </code> </span> </a> against a replica set member and the operation modifies the data or the metadata, you must still perform a full resync in order for the member to rejoin the replica set. </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Before using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--repair" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --repair </code> </span> </a> , make a backup copy of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--dbpath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> dbpath </code> </span> </a> directory. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If repair fails to complete for any reason, you must restart the instance using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--repair" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --repair </code> </span> </a> option. </p> </li> </ul> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --journalCommitInterval &lt;value&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--journalCommitInterval" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--journalCommitInterval"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : 100 </p> <p class="leafygreen-ui-1kp3ins"> The maximum amount of time in milliseconds that the <code class="leafygreen-ui-1l06pbn"> mongod </code> process allows between journal operations. Values can range from 1 to 500 milliseconds. Lower values increase the durability of the journal, at the expense of disk performance. </p> <p class="leafygreen-ui-1kp3ins"> On WiredTiger, the default journal commit interval is 100 milliseconds. A write that includes or implies <code class="leafygreen-ui-1l06pbn"> j:true </code> causes an immediate sync of the journal. For details and additional conditions that affect the frequency of the sync, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/journaling/#std-label-journal-process"> Journaling Process. </a> </p> <p class="leafygreen-ui-1kp3ins"> Not available for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> instances that use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/inmemory/#std-label-storage-inmemory"> in-memory storage engine. </a> </p> </dd> </dl> <span class="leafygreen-ui-1qnjd6d" id="std-label-cli-wiredtiger-options"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> WiredTiger Options <a class="headerlink leafygreen-ui-1kepx47" href="#wiredtiger-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="wiredtiger-options"> </div> </a> </h3> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --wiredTigerCacheSizeGB &lt;float&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--wiredTigerCacheSizeGB" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--wiredTigerCacheSizeGB"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Defines the maximum size of the internal cache that WiredTiger uses for all data. The memory consumed by an index build (see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.maxIndexBuildMemoryUsageMegabytes"> <code class="leafygreen-ui-1l06pbn"> maxIndexBuildMemoryUsageMegabytes </code> </a> ) is separate from the WiredTiger cache memory. </p> <p class="leafygreen-ui-1kp3ins"> Values can range from <code class="leafygreen-ui-1l06pbn"> 0.25 </code> GB to <code class="leafygreen-ui-1l06pbn"> 10000 </code> GB. </p> <p class="leafygreen-ui-1kp3ins"> The default WiredTiger internal cache size is the larger of either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 50% of (RAM - 1 GB), or </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> 256 MB. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For example, on a system with a total of 4GB of RAM the WiredTiger cache uses 1.5GB of RAM ( <code class="leafygreen-ui-1l06pbn"> 0.5 * (4 GB - 1 GB) = 1.5 GB </code> ). Conversely, on a system with a total of 1.25 GB of RAM WiredTiger allocates 256 MB to the WiredTiger cache because that is more than half of the total RAM minus one gigabyte ( <code class="leafygreen-ui-1l06pbn"> 0.5 * (1.25 GB - 1 GB) = 128 MB &lt; 256 MB </code> ). </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> In some instances, such as when running in a container, the database can have memory constraints that are lower than the total system memory. In such instances, this memory limit, rather than the total system memory, is used as the maximum RAM available. </p> <p class="leafygreen-ui-1kp3ins"> To see the memory limit, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hostInfo/#mongodb-data-hostInfo.system.memLimitMB"> <code class="leafygreen-ui-1l06pbn"> hostInfo.system.memLimitMB </code> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Avoid increasing the WiredTiger internal cache size above its default value. </p> <p class="leafygreen-ui-1kp3ins"> With WiredTiger, MongoDB utilizes both the WiredTiger internal cache and the filesystem cache. </p> <p class="leafygreen-ui-1kp3ins"> With the filesystem cache, MongoDB automatically uses all free memory that is not used by the WiredTiger cache or by other processes. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--wiredTigerCacheSizeGB" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --wiredTigerCacheSizeGB </code> </span> </a> limits the size of the WiredTiger internal cache. The operating system uses the available free memory for filesystem cache, which allows the compressed MongoDB data files to stay in memory. In addition, the operating system uses any free RAM to buffer file system blocks and file system cache. </p> <p class="leafygreen-ui-1kp3ins"> To accommodate the additional consumers of RAM, you may have to decrease WiredTiger internal cache size. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The default WiredTiger internal cache size value assumes that there is a single <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> instance per machine. If a single machine contains multiple MongoDB instances, then you should decrease the setting to accommodate the other <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> instances. </p> <p class="leafygreen-ui-1kp3ins"> If you run <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> in a container (for example, <code class="leafygreen-ui-1l06pbn"> lxc </code> , <code class="leafygreen-ui-1l06pbn"> cgroups </code> , Docker, etc.) that does <em> not </em> have access to all of the RAM available in a system, you must set <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--wiredTigerCacheSizeGB" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --wiredTigerCacheSizeGB </code> </span> </a> to a value less than the amount of RAM available in the container. The exact amount depends on the other processes running in the container. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hostInfo/#mongodb-data-hostInfo.system.memLimitMB"> <code class="leafygreen-ui-1l06pbn"> memLimitMB </code> . </a> </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --wiredTigerJournalCompressor &lt;compressor&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--wiredTigerJournalCompressor" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--wiredTigerJournalCompressor"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : snappy </p> <p class="leafygreen-ui-1kp3ins"> Specifies the type of compression to use to compress WiredTiger journal data. </p> <p class="leafygreen-ui-1kp3ins"> Available compressors are: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> none </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-snappy"> snappy </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-zlib"> zlib </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-zstd"> zstd </a> </p> </li> </ul> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --wiredTigerDirectoryForIndexes </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--wiredTigerDirectoryForIndexes" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--wiredTigerDirectoryForIndexes"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> When you start <code class="leafygreen-ui-1l06pbn"> mongod </code> with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--wiredTigerDirectoryForIndexes" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --wiredTigerDirectoryForIndexes </code> </span> </a> , <code class="leafygreen-ui-1l06pbn"> mongod </code> stores indexes and collections in separate subdirectories under the data (i.e. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--dbpath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> </span> </a> ) directory. Specifically, <code class="leafygreen-ui-1l06pbn"> mongod </code> stores the indexes in a subdirectory named <code class="leafygreen-ui-1l06pbn"> index </code> and the collection data in a subdirectory named <code class="leafygreen-ui-1l06pbn"> collection </code> . </p> <p class="leafygreen-ui-1kp3ins"> By using a symbolic link, you can specify a different location for the indexes. Specifically, when <code class="leafygreen-ui-1l06pbn"> mongod </code> instance is <strong> not </strong> running, move the <code class="leafygreen-ui-1l06pbn"> index </code> subdirectory to the destination and create a symbolic link named <code class="leafygreen-ui-1l06pbn"> index </code> under the data directory to the new destination. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --wiredTigerCollectionBlockCompressor &lt;compressor&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--wiredTigerCollectionBlockCompressor" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--wiredTigerCollectionBlockCompressor"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : snappy </p> <p class="leafygreen-ui-1kp3ins"> Specifies the default compression for collection data. You can override this on a per-collection basis when creating collections. </p> <p class="leafygreen-ui-1kp3ins"> Available compressors are: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> none </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-snappy"> snappy </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-zlib"> zlib </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-zstd"> zstd </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--wiredTigerCollectionBlockCompressor" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --wiredTigerCollectionBlockCompressor </code> </span> </a> affects all collections created. If you change the value of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--wiredTigerCollectionBlockCompressor" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --wiredTigerCollectionBlockCompressor </code> </span> </a> on an existing MongoDB deployment, all new collections use the specified compressor. Existing collections continue to use the compressor specified when they were created, or the default compressor at that time. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --wiredTigerIndexPrefixCompression &lt;boolean&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--wiredTigerIndexPrefixCompression" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--wiredTigerIndexPrefixCompression"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : true </p> <p class="leafygreen-ui-1kp3ins"> Enables or disables <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-prefix-compression"> prefix compression </a> for index data. </p> <p class="leafygreen-ui-1kp3ins"> Specify <code class="leafygreen-ui-1l06pbn"> true </code> for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--wiredTigerIndexPrefixCompression" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --wiredTigerIndexPrefixCompression </code> </span> </a> to enable <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-prefix-compression"> prefix compression </a> for index data, or <code class="leafygreen-ui-1l06pbn"> false </code> to disable prefix compression for index data. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--wiredTigerIndexPrefixCompression" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --wiredTigerIndexPrefixCompression </code> </span> </a> setting affects all indexes created. If you change the value of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--wiredTigerIndexPrefixCompression" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --wiredTigerIndexPrefixCompression </code> </span> </a> on an existing MongoDB deployment, all new indexes use prefix compression. Existing indexes are not affected. </p> </dd> </dl> <span class="leafygreen-ui-1qnjd6d" id="std-label-cli-mongod-replica-set"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Replication Options <a class="headerlink leafygreen-ui-1kepx47" href="#replication-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="replication-options"> </div> </a> </h3> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --replSet &lt;setname&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--replSet" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--replSet"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Configures replication. Specify a replica set name as an argument to this set. All hosts in the replica set must have the same set name. </p> <p class="leafygreen-ui-1kp3ins"> If your application connects to more than one replica set, each set must have a distinct name. Some drivers group replica set connections by replica set name. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --oplogSize &lt;value&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--oplogSize" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--oplogSize"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The maximum size in megabytes for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> . The <code class="leafygreen-ui-1l06pbn"> oplogSize </code> setting configures the uncompressed size of the oplog, not the size on disk. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The oplog can grow past its configured size limit to avoid deleting the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetGetStatus/#mongodb-data-replSetGetStatus.optimes.lastCommittedOpTime"> <code class="leafygreen-ui-1l06pbn"> majority commit point </code> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> By default, the <code class="leafygreen-ui-1l06pbn"> mongod </code> process creates an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> based on the maximum amount of space available. For 64-bit systems, the oplog is typically 5% of available disk space. </p> <p class="leafygreen-ui-1kp3ins"> Once the <code class="leafygreen-ui-1l06pbn"> mongod </code> has created the oplog for the first time, changing the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--oplogSize" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --oplogSize </code> </span> </a> option doesn't affect the size of the oplog. To change the minimum oplog retention period after starting the <code class="leafygreen-ui-1l06pbn"> mongod </code> , use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetResizeOplog/#mongodb-dbcommand-dbcmd.replSetResizeOplog"> <code class="leafygreen-ui-1l06pbn"> replSetResizeOplog </code> </a> . <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetResizeOplog/#mongodb-dbcommand-dbcmd.replSetResizeOplog"> <code class="leafygreen-ui-1l06pbn"> replSetResizeOplog </code> </a> enables you to resize the oplog dynamically without restarting the <code class="leafygreen-ui-1l06pbn"> mongod </code> process. To persist the changes made using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetResizeOplog/#mongodb-dbcommand-dbcmd.replSetResizeOplog"> <code class="leafygreen-ui-1l06pbn"> replSetResizeOplog </code> </a> through a restart, update the value of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--oplogSize" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --oplogSize </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-oplog/#std-label-replica-set-oplog-sizing"> Oplog Size </a> for more information. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --oplogMinRetentionHours &lt;value&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--oplogMinRetentionHours" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--oplogMinRetentionHours"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the minimum number of hours to preserve an oplog entry, where the decimal values represent the fractions of an hour. For example, a value of <code class="leafygreen-ui-1l06pbn"> 1.5 </code> represents one hour and thirty minutes. </p> <p class="leafygreen-ui-1kp3ins"> The value must be greater than or equal to <code class="leafygreen-ui-1l06pbn"> 0 </code> . A value of <code class="leafygreen-ui-1l06pbn"> 0 </code> indicates that the <code class="leafygreen-ui-1l06pbn"> mongod </code> should truncate the oplog starting with the oldest entries to maintain the configured maximum oplog size. </p> <p class="leafygreen-ui-1kp3ins"> Defaults to <code class="leafygreen-ui-1l06pbn"> 0 </code> . </p> <p class="leafygreen-ui-1kp3ins"> A <code class="leafygreen-ui-1l06pbn"> mongod </code> started with <code class="leafygreen-ui-1l06pbn"> --oplogMinRetentionHours </code> only removes an oplog entry <em> if </em> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The oplog has reached the maximum configured oplog size <em> and </em> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The oplog entry is older than the configured number of hours based on the host system clock. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> mongod </code> has the following behavior when configured with a minimum oplog retention period: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The oplog can grow without constraint so as to retain oplog entries for the configured number of hours. This may result in reduction or exhaustion of system disk space due to a combination of high write volume and large retention period. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the oplog grows beyond its maximum size, the <code class="leafygreen-ui-1l06pbn"> mongod </code> may continue to hold that disk space even if the oplog returns to its maximum size <em> or </em> is configured for a smaller maximum size. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetResizeOplog/#std-label-replSetResizeOplog-cmd-compact"> Reducing Oplog Size Does Not Immediately Return Disk Space. </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> mongod </code> compares the system wall clock to an oplog entries creation wall clock time when enforcing oplog entry retention. Clock drift between cluster components may result in unexpected oplog retention behavior. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/production-notes/#std-label-production-notes-clock-synchronization"> Clock Synchronization </a> for more information on clock synchronization across cluster members. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> To change the minimum oplog retention period after starting the <code class="leafygreen-ui-1l06pbn"> mongod </code> , use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetResizeOplog/#mongodb-dbcommand-dbcmd.replSetResizeOplog"> <code class="leafygreen-ui-1l06pbn"> replSetResizeOplog </code> </a> . <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetResizeOplog/#mongodb-dbcommand-dbcmd.replSetResizeOplog"> <code class="leafygreen-ui-1l06pbn"> replSetResizeOplog </code> </a> enables you to resize the oplog dynamically without restarting the <code class="leafygreen-ui-1l06pbn"> mongod </code> process. To persist the changes made using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetResizeOplog/#mongodb-dbcommand-dbcmd.replSetResizeOplog"> <code class="leafygreen-ui-1l06pbn"> replSetResizeOplog </code> </a> through a restart, update the value of <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--oplogMinRetentionHours" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --oplogMinRetentionHours </code> . </span> </a> </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --enableMajorityReadConcern </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--enableMajorityReadConcern" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--enableMajorityReadConcern"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : true </p> <p class="leafygreen-ui-1kp3ins"> Configures support for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> read concern. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--enableMajorityReadConcern" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --enableMajorityReadConcern </code> </span> </a> cannot be changed and is always set to <code class="leafygreen-ui-1l06pbn"> true </code> . In earlier versions of MongoDB, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--enableMajorityReadConcern" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --enableMajorityReadConcern </code> </span> </a> was configurable. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If you are using a three-member primary-secondary-arbiter (PSA) architecture, consider the following: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The write concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> can cause performance issues if a secondary is unavailable or lagging. For advice on how to mitigate these issues, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/mitigate-psa-performance-issues/#std-label-performance-issues-psa"> Mitigate Performance Issues with a Self-Managed PSA Replica Set. </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you are using a global default <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> and the write concern is less than the size of the majority, your queries may return stale (not fully replicated) data. </p> </li> </ul> </div> </div> </dd> </dl> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sharded Cluster Options <a class="headerlink leafygreen-ui-1kepx47" href="#sharded-cluster-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sharded-cluster-options"> </div> </a> </h3> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --configsvr </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--configsvr" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--configsvr"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Required if starting a config server. </em> </p> <p class="leafygreen-ui-1kp3ins"> Declares that this <code class="leafygreen-ui-1l06pbn"> mongod </code> instance serves as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-config-servers/#std-label-sharded-cluster-config-server"> config server </a> of a sharded cluster. When running with this option, clients (i.e. other cluster components) cannot write data to any database other than <code class="leafygreen-ui-1l06pbn"> config </code> and <code class="leafygreen-ui-1l06pbn"> admin </code> . The default port for a <code class="leafygreen-ui-1l06pbn"> mongod </code> with this option is <code class="leafygreen-ui-1l06pbn"> 27019 </code> and the default <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--dbpath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> </span> </a> directory is <code class="leafygreen-ui-1l06pbn"> /data/configdb </code> , unless specified. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> When starting a MongoDB server with <code class="leafygreen-ui-1l06pbn"> --configsvr </code> , you must also specify a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--replSet" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --replSet </code> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The use of the deprecated mirrored <code class="leafygreen-ui-1l06pbn"> mongod </code> instances as config servers (SCCC) is no longer supported. </p> <p class="leafygreen-ui-1kp3ins"> The replica set config servers (CSRS) must run the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/wiredtiger/#std-label-storage-wiredtiger"> WiredTiger storage engine. </a> </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--configsvr" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --configsvr </code> </span> </a> option creates a local <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog. </a> </p> <p class="leafygreen-ui-1kp3ins"> Do not use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--configsvr" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --configsvr </code> </span> </a> option with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--shardsvr" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --shardsvr </code> </span> </a> . Config servers cannot be a shard server. </p> <p class="leafygreen-ui-1kp3ins"> Do not use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--configsvr" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --configsvr </code> </span> </a> with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.skipShardingConfigurationChecks"> <code class="leafygreen-ui-1l06pbn"> skipShardingConfigurationChecks </code> </a> parameter. That is, if you are temporarily starting the <code class="leafygreen-ui-1l06pbn"> mongod </code> as a standalone for maintenance operations, include the parameter <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.skipShardingConfigurationChecks"> <code class="leafygreen-ui-1l06pbn"> skipShardingConfigurationChecks </code> </a> and exclude <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--configsvr" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --configsvr </code> </span> </a> . Once maintenance has completed, remove the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.skipShardingConfigurationChecks"> <code class="leafygreen-ui-1l06pbn"> skipShardingConfigurationChecks </code> </a> parameter and restart with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--configsvr" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --configsvr </code> . </span> </a> </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --shardsvr </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--shardsvr" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--shardsvr"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Required if starting a shard server. </em> </p> <p class="leafygreen-ui-1kp3ins"> Configures this <code class="leafygreen-ui-1l06pbn"> mongod </code> instance as a shard in a sharded cluster. The default port for these instances is <code class="leafygreen-ui-1l06pbn"> 27018 </code> . </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> When starting a MongoDB server with <code class="leafygreen-ui-1l06pbn"> --shardsvr </code> , you must also specify a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--replSet" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --replSet </code> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Do not use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--shardsvr" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --shardsvr </code> </span> </a> with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.skipShardingConfigurationChecks"> <code class="leafygreen-ui-1l06pbn"> skipShardingConfigurationChecks </code> </a> parameter. That is, if you are temporarily starting the <code class="leafygreen-ui-1l06pbn"> mongod </code> as a standalone for maintenance operations, include the parameter <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.skipShardingConfigurationChecks"> <code class="leafygreen-ui-1l06pbn"> skipShardingConfigurationChecks </code> </a> and exclude <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--shardsvr" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --shardsvr </code> </span> </a> . Once maintenance has completed, remove the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.skipShardingConfigurationChecks"> <code class="leafygreen-ui-1l06pbn"> skipShardingConfigurationChecks </code> </a> parameter and restart with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--shardsvr" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --shardsvr </code> . </span> </a> </p> </dd> </dl> <span class="leafygreen-ui-1qnjd6d" id="std-label-tls-mongod-options"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> TLS Options <a class="headerlink leafygreen-ui-1kepx47" href="#tls-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="tls-options"> </div> </a> </h3> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> for full documentation of MongoDB's support. </p> </div> </div> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsMode &lt;mode&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsMode" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsMode"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Enables TLS used for all network connections. The argument to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsMode" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsMode </code> </span> </a> option can be one of the following: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width: 20%;"/> <col style="width: 40%;"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> disabled </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The server does not use TLS. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> allowTLS </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Connections between servers do not use TLS. For incoming connections, the server accepts both TLS and non-TLS. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> preferTLS </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Connections between servers use TLS. For incoming connections, the server accepts both TLS and non-TLS. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> requireTLS </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The server uses and accepts only TLS encrypted connections. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> or <code class="leafygreen-ui-1l06pbn"> tls.CAFile </code> is not specified and you are not using x.509 authentication, you must set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.tlsUseSystemCA"> <code class="leafygreen-ui-1l06pbn"> tlsUseSystemCA </code> </a> parameter to <code class="leafygreen-ui-1l06pbn"> true </code> . This makes MongoDB use the system-wide CA certificate store when connecting to a TLS-enabled server. </p> <p class="leafygreen-ui-1kp3ins"> If using x.509 authentication, <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> or <code class="leafygreen-ui-1l06pbn"> tls.CAFile </code> must be specified unless using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> For more information about TLS and MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl-clients/"> TLS/SSL Configuration for Clients </a> . </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateKeyFile &lt;filename&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsCertificateKeyFile" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsCertificateKeyFile"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the <code class="file docutils literal"> <span class="pre"> .pem </span> </code> file that contains both the TLS certificate and key. </p> <p class="leafygreen-ui-1kp3ins"> On macOS or Windows, you can use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> option to specify a certificate from the operating system's secure certificate store instead of a PEM key file. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateKeyFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateKeyFile </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> options are mutually exclusive. You can only specify one. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> On Linux/BSD, you must specify <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateKeyFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateKeyFile </code> </span> </a> when TLS/SSL is enabled. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> On Windows or macOS, you must specify either <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateKeyFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateKeyFile </code> </span> </a> or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> when TLS/SSL is enabled. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For Windows <strong> only </strong> , MongoDB does not support encrypted PEM files. The <code class="leafygreen-ui-1l06pbn"> mongod </code> fails to start if it encounters an encrypted PEM file. To securely store and access a certificate for use with TLS on Windows, use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> . </span> </a> </p> </div> </div> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For more information about TLS and MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl-clients/"> TLS/SSL Configuration for Clients </a> . </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateKeyFilePassword &lt;value&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsCertificateKeyFilePassword" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsCertificateKeyFilePassword"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the password to decrypt the certificate-key file (i.e. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateKeyFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateKeyFile </code> </span> </a> ). Use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateKeyFilePassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateKeyFilePassword </code> </span> </a> option only if the certificate-key file is encrypted. In all cases, the <code class="leafygreen-ui-1l06pbn"> mongod </code> redacts the password from all logging and reporting output. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> On Linux/BSD, if the private key in the PEM file is encrypted and you do not specify the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateKeyFilePassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateKeyFilePassword </code> </span> </a> option, MongoDB prompts for a passphrase. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/#std-label-ssl-certificate-password"> TLS/SSL Certificate Passphrase. </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> On macOS, if the private key in the PEM file is encrypted, you must explicitly specify the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateKeyFilePassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateKeyFilePassword </code> </span> </a> option. Alternatively, you can use a certificate from the secure system store (see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> ) instead of a PEM file or use an unencrypted PEM file. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> On Windows, MongoDB does not support encrypted certificates. The <code class="leafygreen-ui-1l06pbn"> mongod </code> fails if it encounters an encrypted PEM file. Use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> instead. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For more information about TLS and MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl-clients/"> TLS/SSL Configuration for Clients </a> . </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --clusterAuthMode &lt;option&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--clusterAuthMode" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--clusterAuthMode"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : keyFile </p> <p class="leafygreen-ui-1kp3ins"> The authentication mode used for cluster authentication. If you use <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-x509-member-authentication/#std-label-x509-internal-authentication"> internal x.509 authentication </a> , specify so here. This option can have one of the following values: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width: 20%;"/> <col style="width: 40%;"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> keyFile </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Use a keyfile for authentication. Accept only keyfiles. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> sendKeyFile </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> For rolling upgrade purposes. Send a keyfile for authentication but can accept both keyfiles and x.509 certificates. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> sendX509 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> For rolling upgrade purposes. Send the x.509 certificate for authentication but can accept both keyfiles and x.509 certificates. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> x509 </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Recommended. Send the x.509 certificate for authentication and accept only x.509 certificates. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> or <code class="leafygreen-ui-1l06pbn"> tls.CAFile </code> is not specified and you are not using x.509 authentication, you must set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.tlsUseSystemCA"> <code class="leafygreen-ui-1l06pbn"> tlsUseSystemCA </code> </a> parameter to <code class="leafygreen-ui-1l06pbn"> true </code> . This makes MongoDB use the system-wide CA certificate store when connecting to a TLS-enabled server. </p> <p class="leafygreen-ui-1kp3ins"> If using x.509 authentication, <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> or <code class="leafygreen-ui-1l06pbn"> tls.CAFile </code> must be specified unless using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> For more information about TLS and MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl-clients/"> TLS/SSL Configuration for Clients </a> . </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsClusterFile &lt;filename&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsClusterFile" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsClusterFile"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the <code class="file docutils literal"> <span class="pre"> .pem </span> </code> file that contains the x.509 certificate-key file for <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-x509-member-authentication/#std-label-x509-internal-authentication"> membership authentication </a> for the cluster or replica set. </p> <p class="leafygreen-ui-1kp3ins"> On macOS or Windows, you can use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCertificateSelector </code> </span> </a> option to specify a certificate from the operating system's secure certificate store instead of a PEM key file. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterFile </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCertificateSelector </code> </span> </a> options are mutually exclusive. You can only specify one. </p> <p class="leafygreen-ui-1kp3ins"> If <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterFile </code> </span> </a> does not specify the <code class="leafygreen-ui-1l06pbn"> .pem </code> file for internal cluster authentication or the alternative <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCertificateSelector </code> </span> </a> , the cluster uses the <code class="leafygreen-ui-1l06pbn"> .pem </code> file specified in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateKeyFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateKeyFile </code> </span> </a> option or the certificate returned by the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> If using x.509 authentication, <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> or <code class="leafygreen-ui-1l06pbn"> tls.CAFile </code> must be specified unless using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> / <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> logs a warning on connection if the presented x.509 certificate expires within <code class="leafygreen-ui-1l06pbn"> 30 </code> days of the <code class="leafygreen-ui-1l06pbn"> mongod/mongos </code> host system time. </p> <p class="leafygreen-ui-1kp3ins"> For more information about TLS and MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl-clients/"> TLS/SSL Configuration for Clients </a> . </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For Windows <strong> only </strong> , MongoDB does not support encrypted PEM files. The <code class="leafygreen-ui-1l06pbn"> mongod </code> fails to start if it encounters an encrypted PEM file. To securely store and access a certificate for use with membership authentication on Windows, use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCertificateSelector </code> . </span> </a> </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector &lt;parameter&gt;=&lt;value&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsCertificateSelector" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsCertificateSelector"> </div> </a> </dt> <dd> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available on Windows and macOS as an alternative to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateKeyFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateKeyFile </code> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Specifies a certificate property in order to select a matching certificate from the operating system's certificate store to use for TLS. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateKeyFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateKeyFile </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> options are mutually exclusive. You can only specify one. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> accepts an argument of the format <code class="leafygreen-ui-1l06pbn"> &lt;property&gt;=&lt;value&gt; </code> where the property can be one of the following: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Property </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> subject </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ASCII string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Subject name or common name on certificate </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> thumbprint </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> hex string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> A sequence of bytes, expressed as hexadecimal, used to identify a public key by its SHA-1 digest. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> thumbprint </code> is sometimes referred to as a <code class="leafygreen-ui-1l06pbn"> fingerprint </code> . </p> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> When using the system SSL certificate store, OCSP (Online Certificate Status Protocol) is used to validate the revocation status of certificates. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> mongod </code> searches the operating system's secure certificate store for the CA certificates required to validate the full certificate chain of the specified TLS certificate. Specifically, the secure certificate store must contain the root CA and any intermediate CA certificates required to build the full certificate chain to the TLS certificate. Do <strong> not </strong> use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> </span> </a> or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCAFile </code> </span> </a> to specify the root and intermediate CA certificate </p> <p class="leafygreen-ui-1kp3ins"> For example, if the TLS/SSL certificate was signed with a single root CA certificate, the secure certificate store must contain that root CA certificate. If the TLS/SSL certificate was signed with an intermediate CA certificate, the secure certificate store must contain the intermedia CA certificate <em> and </em> the root CA certificate. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You cannot use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/rotateCertificates/#mongodb-dbcommand-dbcmd.rotateCertificates"> <code class="leafygreen-ui-1l06pbn"> rotateCertificates </code> </a> command or the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.rotateCertificates/#mongodb-method-db.rotateCertificates"> <code class="leafygreen-ui-1l06pbn"> db.rotateCertificates() </code> </a> shell method when using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.certificateSelector"> <code class="leafygreen-ui-1l06pbn"> net.tls.certificateSelector </code> </a> or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> set to <code class="leafygreen-ui-1l06pbn"> thumbprint </code> </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCertificateSelector &lt;parameter&gt;=&lt;value&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsClusterCertificateSelector" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsClusterCertificateSelector"> </div> </a> </dt> <dd> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available on Windows and macOS as an alternative to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterFile </code> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Specifies a certificate property in order to select a matching certificate from the operating system's certificate store for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-internal-auth-x509"> internal x.509 membership authentication. </a> </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterFile </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCertificateSelector </code> </span> </a> options are mutually exclusive. You can only specify one. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCertificateSelector </code> </span> </a> accepts an argument of the format <code class="leafygreen-ui-1l06pbn"> &lt;property&gt;=&lt;value&gt; </code> where the property can be one of the following: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Property </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> subject </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ASCII string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Subject name or common name on certificate </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> thumbprint </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> hex string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> A sequence of bytes, expressed as hexadecimal, used to identify a public key by its SHA-1 digest. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> thumbprint </code> is sometimes referred to as a <code class="leafygreen-ui-1l06pbn"> fingerprint </code> . </p> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> mongod </code> searches the operating system's secure certificate store for the CA certificates required to validate the full certificate chain of the specified cluster certificate. Specifically, the secure certificate store must contain the root CA and any intermediate CA certificates required to build the full certificate chain to the cluster certificate. Do <strong> not </strong> use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> </span> </a> or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCAFile </code> </span> </a> to specify the root and intermediate CA certificate. </p> <p class="leafygreen-ui-1kp3ins"> For example, if the cluster certificate was signed with a single root CA certificate, the secure certificate store must contain that root CA certificate. If the cluster certificate was signed with an intermediate CA certificate, the secure certificate store must contain the intermedia CA certificate <em> and </em> the root CA certificate. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> / <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> logs a warning on connection if the presented x.509 certificate expires within <code class="leafygreen-ui-1l06pbn"> 30 </code> days of the <code class="leafygreen-ui-1l06pbn"> mongod/mongos </code> host system time. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsClusterPassword &lt;value&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsClusterPassword" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsClusterPassword"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the password to decrypt the x.509 certificate-key file specified with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterFile </code> </span> </a> . Use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterPassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterPassword </code> </span> </a> option only if the certificate-key file is encrypted. In all cases, the <code class="leafygreen-ui-1l06pbn"> mongod </code> redacts the password from all logging and reporting output. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> On Linux/BSD, if the private key in the x.509 file is encrypted and you do not specify the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterPassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterPassword </code> </span> </a> option, MongoDB prompts for a passphrase. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/#std-label-ssl-certificate-password"> TLS/SSL Certificate Passphrase. </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> On macOS, if the private key in the x.509 file is encrypted, you must explicitly specify the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterPassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterPassword </code> </span> </a> option. Alternatively, you can either use a certificate from the secure system store (see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCertificateSelector </code> </span> </a> ) instead of a cluster PEM file or use an unencrypted PEM file. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> On Windows, MongoDB does not support encrypted certificates. The <code class="leafygreen-ui-1l06pbn"> mongod </code> fails if it encounters an encrypted PEM file. Use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCertificateSelector </code> </span> </a> instead. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For more information about TLS and MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl-clients/"> TLS/SSL Configuration for Clients </a> . </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsCAFile &lt;filename&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsCAFile" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsCAFile"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the <code class="file docutils literal"> <span class="pre"> .pem </span> </code> file that contains the root certificate chain from the Certificate Authority. Specify the file name of the <code class="file docutils literal"> <span class="pre"> .pem </span> </code> file using relative or absolute paths. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> When starting a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> instance with <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/#std-label-configure-mongod-mongos-for-tls-ssl"> TLS/SSL enabled </a> , you must specify a value for the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> </span> </a> flag, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.tls.CAFile"> <code class="leafygreen-ui-1l06pbn"> net.tls.CAFile </code> </a> configuration option, or the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.tlsUseSystemCA"> <code class="leafygreen-ui-1l06pbn"> tlsUseSystemCA </code> </a> parameter. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> , <code class="leafygreen-ui-1l06pbn"> tls.CAFile </code> , and <code class="leafygreen-ui-1l06pbn"> tlsUseSystemCA </code> are all mutually exclusive. </p> </div> </div> <dl> <dt> Windows/macOS Only </dt> <dd class="css-1ufxuu7"> If using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> and/or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCertificateSelector </code> </span> </a> , do <strong> not </strong> use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> </span> </a> to specify the root and intermediate CA certificates. Store all CA certificates required to validate the full trust chain of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> and/or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCertificateSelector </code> </span> </a> certificates in the secure certificate store. </dd> </dl> <p class="leafygreen-ui-1kp3ins"> For more information about TLS and MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl-clients/"> TLS/SSL Configuration for Clients </a> . </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCAFile &lt;filename&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsClusterCAFile" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsClusterCAFile"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the <code class="file docutils literal"> <span class="pre"> .pem </span> </code> file that contains the root certificate chain from the Certificate Authority used to validate the certificate presented by a client establishing a connection. Specify the file name of the <code class="file docutils literal"> <span class="pre"> .pem </span> </code> file using relative or absolute paths. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCAFile </code> </span> </a> requires that <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> </span> </a> is set. </p> <p class="leafygreen-ui-1kp3ins"> If <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCAFile </code> </span> </a> does not specify the <code class="file docutils literal"> <span class="pre"> .pem </span> </code> file for validating the certificate from a client establishing a connection, the cluster uses the <code class="file docutils literal"> <span class="pre"> .pem </span> </code> file specified in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> </span> </a> option. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCAFile </code> </span> </a> lets you use separate Certificate Authorities to verify the client to server and server to client portions of the TLS handshake. </p> <dl> <dt> Windows/macOS Only </dt> <dd class="css-1ufxuu7"> If using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> and/or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCertificateSelector </code> </span> </a> , do <strong> not </strong> use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCAFile </code> </span> </a> to specify the root and intermediate CA certificates. Store all CA certificates required to validate the full trust chain of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> and/or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsClusterCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsClusterCertificateSelector </code> </span> </a> certificates in the secure certificate store. </dd> </dl> <p class="leafygreen-ui-1kp3ins"> For more information about TLS and MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl-clients/"> TLS/SSL Configuration for Clients </a> . </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsCRLFile &lt;filename&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsCRLFile" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsCRLFile"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the <code class="file docutils literal"> <span class="pre"> .pem </span> </code> file that contains the Certificate Revocation List. Specify the file name of the <code class="file docutils literal"> <span class="pre"> .pem </span> </code> file using relative or absolute paths. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot specify a CRL file on macOS. Instead, you can use the system SSL certificate store, which uses OCSP (Online Certificate Status Protocol) to validate the revocation status of certificates. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCertificateSelector </code> </span> </a> to use the system SSL certificate store. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To check for certificate revocation, MongoDB <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.ocspEnabled"> <code class="leafygreen-ui-1l06pbn"> enables </code> </a> the use of OCSP (Online Certificate Status Protocol) by default as an alternative to specifying a CRL file or using the system SSL certificate store. </p> </li> </ul> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information about TLS and MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl-clients/"> TLS/SSL Configuration for Clients </a> . </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsAllowInvalidCertificates </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsAllowInvalidCertificates" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsAllowInvalidCertificates"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Bypasses the validation checks for TLS certificates on other servers in the cluster and allows the use of invalid certificates to connect. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If you specify <code class="leafygreen-ui-1l06pbn"> --tlsAllowInvalidCertificates </code> or <code class="leafygreen-ui-1l06pbn"> tls.allowInvalidCertificates: true </code> when using x.509 authentication, an invalid certificate is only sufficient to establish a TLS connection but is <em> insufficient </em> for authentication. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> When using the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsAllowInvalidCertificates" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsAllowInvalidCertificates </code> </span> </a> setting, MongoDB logs a warning regarding the use of the invalid certificate. </p> <p class="leafygreen-ui-1kp3ins"> For more information about TLS and MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl-clients/"> TLS/SSL Configuration for Clients </a> . </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsAllowInvalidHostnames </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsAllowInvalidHostnames" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsAllowInvalidHostnames"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Disables the validation of the hostnames in TLS certificates, when connecting to other members of the replica set or sharded cluster for inter-process authentication. This allows <code class="leafygreen-ui-1l06pbn"> mongod </code> to connect to other members if the hostnames in their certificates do not match their configured hostname. </p> <p class="leafygreen-ui-1kp3ins"> For more information about TLS and MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl-clients/"> TLS/SSL Configuration for Clients </a> . </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsAllowConnectionsWithoutCertificates </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsAllowConnectionsWithoutCertificates" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsAllowConnectionsWithoutCertificates"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> By default, the server bypasses client certificate validation unless the server is configured to use a CA file. If a CA file is provided, the following rules apply: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For clients that don't provide certificates, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> encrypts the TLS/SSL connection, assuming the connection is successfully made. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For clients that present a certificate, <code class="leafygreen-ui-1l06pbn"> mongod </code> performs certificate validation using the root certificate chain specified by <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsCAFile </code> </span> </a> and reject clients with invalid certificates. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsAllowConnectionsWithoutCertificates" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsAllowConnectionsWithoutCertificates </code> </span> </a> option if you have a mixed deployment that includes clients that do not or cannot present certificates to the <code class="leafygreen-ui-1l06pbn"> mongod </code> . </p> <p class="leafygreen-ui-1kp3ins"> For more information about TLS and MongoDB, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl-clients/"> TLS/SSL Configuration for Clients </a> . </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsDisabledProtocols &lt;protocol(s)&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsDisabledProtocols" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsDisabledProtocols"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Prevents a MongoDB server running with TLS from accepting incoming connections that use a specific protocol or protocols. To specify multiple protocols, use a comma separated list of protocols. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsDisabledProtocols" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsDisabledProtocols </code> </span> </a> recognizes the following protocols: <code class="leafygreen-ui-1l06pbn"> TLS1_0 </code> , <code class="leafygreen-ui-1l06pbn"> TLS1_1 </code> , <code class="leafygreen-ui-1l06pbn"> TLS1_2 </code> , and <code class="leafygreen-ui-1l06pbn"> TLS1_3 </code> . </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> On macOS, you cannot disable <code class="leafygreen-ui-1l06pbn"> TLS1_1 </code> and leave both <code class="leafygreen-ui-1l06pbn"> TLS1_0 </code> and <code class="leafygreen-ui-1l06pbn"> TLS1_2 </code> enabled. You must disable at least one of the other two, for example, <code class="leafygreen-ui-1l06pbn"> TLS1_0,TLS1_1 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To list multiple protocols, specify as a comma separated list of protocols. For example <code class="leafygreen-ui-1l06pbn"> TLS1_0,TLS1_1 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Specifying an unrecognized protocol prevents the server from starting. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The specified disabled protocols overrides any default disabled protocols. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> MongoDB disables the use of TLS 1.0 if TLS 1.1+ is available on the system. To enable the disabled TLS 1.0, specify <code class="leafygreen-ui-1l06pbn"> none </code> to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsDisabledProtocols" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsDisabledProtocols </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> Members of replica sets and sharded clusters must speak at least one protocol in common. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/#std-label-ssl-disallow-protocols"> Disallow Protocols </a> </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --tlsFIPSMode </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--tlsFIPSMode" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--tlsFIPSMode"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Directs the <code class="leafygreen-ui-1l06pbn"> mongod </code> to use the FIPS mode of the TLS library. Your system must have a FIPS compliant library to use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--tlsFIPSMode" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --tlsFIPSMode </code> </span> </a> option. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> FIPS-compatible TLS/SSL is available only in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.mongodb.com/products/mongodb-enterprise-advanced?tck=docs_server" target="_self"> <span> MongoDB Enterprise </span> </a> . See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-fips/"> Configure MongoDB for FIPS </a> for more information. </p> </div> </div> </dd> </dl> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Profiler Options <a class="headerlink leafygreen-ui-1kepx47" href="#profiler-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="profiler-options"> </div> </a> </h3> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --profile &lt;level&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--profile" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--profile"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : 0 </p> <p class="leafygreen-ui-1kp3ins"> Configures the <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-the-database-profiler/"> database profiler </a> level. The following profiler levels are available: </p> <dl> <dt> <code class="leafygreen-ui-1l06pbn"> 0 </code> </dt> <dd class="css-1ufxuu7"> The profiler is off and does not collect any data. This is the default profiler level. </dd> <dt> <code class="leafygreen-ui-1l06pbn"> 1 </code> </dt> <dd class="css-1ufxuu7"> <p class="leafygreen-ui-1kp3ins"> The profiler collects data for operations that exceed the <code class="leafygreen-ui-1l06pbn"> slowms </code> threshold or match a specified <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.setProfilingLevel/#std-label-set-profiling-level-options-filter"> filter. </a> </p> <p class="leafygreen-ui-1kp3ins"> When a filter is set: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> slowms </code> and <code class="leafygreen-ui-1l06pbn"> sampleRate </code> options are not used for profiling. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The profiler only captures operations that match the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.setProfilingLevel/#std-label-set-profiling-level-options-filter"> filter. </a> </p> </li> </ul> </dd> <dt> <code class="leafygreen-ui-1l06pbn"> 2 </code> </dt> <dd class="css-1ufxuu7"> The profiler collects data for all operations. </dd> </dl> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Profiling can degrade performance and expose unencrypted query data in the system log. Carefully consider any performance and security implications before configuring and enabling the profiler on a production deployment. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-the-database-profiler/#std-label-database-profiling-overhead"> Profiler Overhead </a> for more information on potential performance degradation. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --slowms &lt;integer&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--slowms" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--slowms"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : 100 </p> <p class="leafygreen-ui-1kp3ins"> The slow operation time threshold, in milliseconds. Operations that run for longer than this threshold are considered <em> slow </em> . </p> <p class="leafygreen-ui-1kp3ins"> Slow operations are logged based on <code class="leafygreen-ui-1l06pbn"> workingMillis </code> , which is the amount of time that MongoDB spends working on that operation. This means that factors such as waiting for locks and flow control do not affect whether an operation exceeds the slow operation threshold. </p> <p class="leafygreen-ui-1kp3ins"> When <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.logLevel"> <code class="leafygreen-ui-1l06pbn"> logLevel </code> </a> is set to <code class="leafygreen-ui-1l06pbn"> 0 </code> , MongoDB records <em> slow </em> operations to the diagnostic log at a rate determined by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-operationProfiling.slowOpSampleRate"> <code class="leafygreen-ui-1l06pbn"> slowOpSampleRate </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> At higher <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.logLevel"> <code class="leafygreen-ui-1l06pbn"> logLevel </code> </a> settings, all operations appear in the diagnostic log regardless of their latency with the following exception: the logging of slow oplog entry messages by the secondaries. The secondaries log only the slow oplog entries; increasing the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.logLevel"> <code class="leafygreen-ui-1l06pbn"> logLevel </code> </a> does not log all oplog entries. </p> <p class="leafygreen-ui-1kp3ins"> For <code class="leafygreen-ui-1l06pbn"> mongod </code> instances, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--slowms" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --slowms </code> </span> </a> affects the diagnostic log and, if enabled, the profiler. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-the-database-profiler/"> Database Profiler </a> </p> </div> </div> </dd> </dl> <span class="leafygreen-ui-1qnjd6d" id="std-label-cli-mongod-profiler-slowOpSampleRate"> </span> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --slowOpSampleRate &lt;double&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--slowOpSampleRate" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--slowOpSampleRate"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : 1.0 </p> <p class="leafygreen-ui-1kp3ins"> The fraction of <em> slow </em> operations that should be profiled or logged. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--slowOpSampleRate" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --slowOpSampleRate </code> </span> </a> accepts values between 0 and 1, inclusive. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--slowOpSampleRate" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --slowOpSampleRate </code> </span> </a> does not affect the slow oplog entry logging by the secondary members of a replica set. Secondary members log all oplog entries that take longer than the slow operation threshold regardless of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--slowOpSampleRate" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --slowOpSampleRate </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> For <code class="leafygreen-ui-1l06pbn"> mongod </code> instances, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--slowOpSampleRate" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --slowOpSampleRate </code> </span> </a> affects the diagnostic log and, if enabled, the profiler. </p> </dd> </dl> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Audit Options <a class="headerlink leafygreen-ui-1kepx47" href="#audit-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="audit-options"> </div> </a> </h3> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --auditCompressionMode </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--auditCompressionMode" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--auditCompressionMode"> </div> </a> </dt> <dd> <div> <p> <em> New in version 5.3 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Specifies the compression mode for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-encryption-at-rest/#std-label-security-encryption-at-rest-audit-log"> audit log encryption </a> . You must also enable audit log encryption using either <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditEncryptionKeyUID" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditEncryptionKeyUID </code> </span> </a> or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditLocalKeyFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditLocalKeyFile </code> </span> </a> . </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditCompressionMode" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditCompressionMode </code> </span> </a> can be set to one of these values: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width: 15%;"/> <col style="width: 50%;"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> zstd </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-zstd"> zstd </a> algorithm to compress the audit log. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> none </code> <em> (default) </em> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Do not compress the audit log. </div> </div> </td> </tr> </tbody> </table> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available only in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.mongodb.com/products/mongodb-enterprise-advanced?tck=docs_server" target="_self"> <span> MongoDB Enterprise </span> </a> . MongoDB Enterprise and Atlas have different configuration requirements. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --auditDestination </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--auditDestination" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--auditDestination"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Enables <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/auditing/#std-label-auditing"> auditing </a> and specifies where <code class="leafygreen-ui-1l06pbn"> mongod </code> sends all audit events. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditDestination" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditDestination </code> </span> </a> can have one of the following values: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width: 15%;"/> <col style="width: 50%;"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> syslog </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Output the audit events to syslog in JSON format. Not available on Windows. Audit messages have a syslog severity level of <code class="leafygreen-ui-1l06pbn"> info </code> and a facility level of <code class="leafygreen-ui-1l06pbn"> user </code> . </p> <p class="leafygreen-ui-1kp3ins"> The syslog message limit can result in the truncation of audit messages. The auditing system neither detects the truncation nor errors upon its occurrence. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> console </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Output the audit events to <code class="leafygreen-ui-1l06pbn"> stdout </code> in JSON format. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> file </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Output the audit events to the file specified in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditPath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditPath </code> </span> </a> in the format specified in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditFormat" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditFormat </code> . </span> </a> </div> </div> </td> </tr> </tbody> </table> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available only in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.mongodb.com/products/mongodb-enterprise-advanced?tck=docs_server" target="_self"> <span> MongoDB Enterprise </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://cloud.mongodb.com/user#/atlas/login" target="_self"> <span> MongoDB Atlas </span> </a> . </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --auditEncryptionKeyUID </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--auditEncryptionKeyUID" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--auditEncryptionKeyUID"> </div> </a> </dt> <dd> <div> <p> <em> New in version 6.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Specifies the unique identifier of the Key Management Interoperability Protocol (KMIP) key for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-encryption-at-rest/#std-label-security-encryption-at-rest-audit-log"> audit log encryption. </a> </p> <p class="leafygreen-ui-1kp3ins"> You cannot use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditEncryptionKeyUID" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditEncryptionKeyUID </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditLocalKeyFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditLocalKeyFile </code> </span> </a> together. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available only in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.mongodb.com/products/mongodb-enterprise-advanced?tck=docs_server" target="_self"> <span> MongoDB Enterprise </span> </a> . MongoDB Enterprise and Atlas have different configuration requirements. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --auditFormat </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--auditFormat" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--auditFormat"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the format of the output file for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/auditing/"> auditing </a> if <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditDestination" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditDestination </code> </span> </a> is <code class="leafygreen-ui-1l06pbn"> file </code> . The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditFormat" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditFormat </code> </span> </a> option can have one of the following values: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width: 15%;"/> <col style="width: 50%;"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> JSON </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Output the audit events in JSON format to the file specified in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditPath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditPath </code> . </span> </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> BSON </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Output the audit events in BSON binary format to the file specified in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditPath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditPath </code> . </span> </a> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> Printing audit events to a file in JSON format degrades server performance more than printing to a file in BSON format. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available only in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.mongodb.com/products/mongodb-enterprise-advanced?tck=docs_server" target="_self"> <span> MongoDB Enterprise </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://cloud.mongodb.com/user#/atlas/login" target="_self"> <span> MongoDB Atlas </span> </a> . </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --auditLocalKeyFile </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--auditLocalKeyFile" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--auditLocalKeyFile"> </div> </a> </dt> <dd> <div> <p> <em> New in version 5.3 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Specifies the path and file name for a local audit key file for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-encryption-at-rest/#std-label-security-encryption-at-rest-audit-log"> audit log encryption. </a> </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Only use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditLocalKeyFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditLocalKeyFile </code> </span> </a> for testing because the key is not secured. To secure the key, use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditEncryptionKeyUID" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditEncryptionKeyUID </code> </span> </a> and an external Key Management Interoperability Protocol (KMIP) server. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> You cannot use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditLocalKeyFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditLocalKeyFile </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditEncryptionKeyUID" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditEncryptionKeyUID </code> </span> </a> together. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available only in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.mongodb.com/products/mongodb-enterprise-advanced?tck=docs_server" target="_self"> <span> MongoDB Enterprise </span> </a> . MongoDB Enterprise and Atlas have different configuration requirements. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --auditPath </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--auditPath" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--auditPath"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the output file for auditing if <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditDestination" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditDestination </code> </span> </a> has value of <code class="leafygreen-ui-1l06pbn"> file </code> . The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--auditPath" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --auditPath </code> </span> </a> option can take either a full path name or a relative path name. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available only in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.mongodb.com/products/mongodb-enterprise-advanced?tck=docs_server" target="_self"> <span> MongoDB Enterprise </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://cloud.mongodb.com/user#/atlas/login" target="_self"> <span> MongoDB Atlas </span> </a> . </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --auditFilter </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--auditFilter" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--auditFilter"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the filter to limit the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/mongo/#std-label-audit-action-details-results"> types of operations </a> the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/auditing/"> audit system </a> records. The option takes a string representation of a query document of the form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ &lt;field1&gt;: &lt;expression1&gt;, ... }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ &lt;field1&gt;: &lt;expression1&gt;, ... }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> &lt;field&gt; </code> can be <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/"> any field in the audit message </a> , including fields returned in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/mongo/#std-label-audit-action-details-results"> param </a> document. The <code class="leafygreen-ui-1l06pbn"> &lt;expression&gt; </code> is a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-selectors"> query condition expression. </a> </p> <p class="leafygreen-ui-1kp3ins"> To specify an audit filter, enclose the filter document in single quotes to pass the document as a string. </p> <p class="leafygreen-ui-1kp3ins"> To specify the audit filter in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#std-label-configuration-options"> configuration file </a> , you must use the YAML format of the configuration file. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available only in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.mongodb.com/products/mongodb-enterprise-advanced?tck=docs_server" target="_self"> <span> MongoDB Enterprise </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://cloud.mongodb.com/user#/atlas/login" target="_self"> <span> MongoDB Atlas </span> </a> . </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --auditSchema </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--auditSchema" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--auditSchema"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : <code class="leafygreen-ui-1l06pbn"> mongo </code> </p> <div> <p> <em> New in version 8.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Specifies the format used for audit logs. You can specify one of the following values for <code class="leafygreen-ui-1l06pbn"> --auditSchema </code> : </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width: 10%;"/> <col style="width: 20%;"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> mongo </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Logs are written in a format designed by MongoDB. </p> <p class="leafygreen-ui-1kp3ins"> For example log messages, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/mongo/#std-label-event-audit-messages-mongo"> mongo Schema Audit Messages. </a> </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> OCSF </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Logs are written in <span class="leafygreen-ui-vm4wms" tabindex="0"> OCSF </span> format. This option provides logs in a standardized format compatible with log processors. </p> <p class="leafygreen-ui-1kp3ins"> For example log messages, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/ocsf/#std-label-event-audit-messages-ocsf"> OCSF Schema Audit Messages. </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> <span class="leafygreen-ui-1qnjd6d" id="std-label-cli-mongod-inmemory"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> inMemory Options <a class="headerlink leafygreen-ui-1kepx47" href="#inmemory-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="inmemory-options"> </div> </a> </h3> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --inMemorySizeGB &lt;float&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--inMemorySizeGB" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--inMemorySizeGB"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : 50% of physical RAM minus 1 GB. </p> <p class="leafygreen-ui-1kp3ins"> Maximum amount of memory to allocate for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/inmemory/"> in-memory storage engine </a> data, including indexes, the oplog (if the <code class="leafygreen-ui-1l06pbn"> mongod </code> is part of a replica set), sharded cluster metadata, etc. </p> <p class="leafygreen-ui-1kp3ins"> Values can range from 256MB to 10TB and can be a float. </p> <p class="leafygreen-ui-1kp3ins"> By default, the in-memory storage engine uses 50% of physical RAM minus 1 GB. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> </dd> </dl> <span class="leafygreen-ui-1qnjd6d" id="std-label-encryption-key-management-options"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Encryption Key Management Options <a class="headerlink leafygreen-ui-1kepx47" href="#encryption-key-management-options" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="encryption-key-management-options"> </div> </a> </h3> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --enableEncryption </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--enableEncryption" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--enableEncryption"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : false </p> <p class="leafygreen-ui-1kp3ins"> Enables encryption for the WiredTiger storage engine. This option must be enabled in order to pass in encryption keys and configurations. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --encryptionCipherMode &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--encryptionCipherMode" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--encryptionCipherMode"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : AES256-CBC </p> <p class="leafygreen-ui-1kp3ins"> The cipher mode to use for encryption at rest: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width: 35%;"/> <col style="width: 65%;"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Mode </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> AES256-CBC </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 256-bit Advanced Encryption Standard in Cipher Block Chaining Mode </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> AES256-GCM </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> 256-bit Advanced Encryption Standard in Galois/Counter Mode </p> <p class="leafygreen-ui-1kp3ins"> Available only on Linux. </p> <p class="leafygreen-ui-1kp3ins"> MongoDB Enterprise on Windows no longer supports <code class="leafygreen-ui-1l06pbn"> AES256-GCM </code> as a block cipher for encryption at rest. This usage is only supported on Linux. </p> </div> </div> </td> </tr> </tbody> </table> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --encryptionKeyFile &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--encryptionKeyFile" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--encryptionKeyFile"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The path to the local keyfile when managing keys via process <em> other than </em> KMIP. Only set when managing keys via process other than KMIP. If data is already encrypted using KMIP, MongoDB throws an error. </p> <p class="leafygreen-ui-1kp3ins"> The keyfile can contain only a single key. The key is either a 16 or 32 character string. </p> <p class="leafygreen-ui-1kp3ins"> Requires <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--enableEncryption" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --enableEncryption </code> . </span> </a> </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --kmipKeyIdentifier &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--kmipKeyIdentifier" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--kmipKeyIdentifier"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Unique KMIP identifier for an existing key within the KMIP server. Include to use the key associated with the identifier as the system key. You can only use the setting the first time you enable encryption for the <code class="leafygreen-ui-1l06pbn"> mongod </code> instance. Requires <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--enableEncryption" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --enableEncryption </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> If unspecified, MongoDB requests that the KMIP server create a new key to utilize as the system key. </p> <p class="leafygreen-ui-1kp3ins"> If the KMIP server cannot locate a key with the specified identifier or the data is already encrypted with a key, MongoDB throws an error </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --kmipRotateMasterKey &lt;boolean&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--kmipRotateMasterKey" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--kmipRotateMasterKey"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : false </p> <p class="leafygreen-ui-1kp3ins"> If true, rotate the master key and re-encrypt the internal keystore. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/rotate-encryption-key/#std-label-kmip-master-key-rotation"> KMIP Master Key Rotation </a> </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --kmipServerName &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--kmipServerName" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--kmipServerName"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Hostname or IP address of the KMIP server to connect to. Requires <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--enableEncryption" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --enableEncryption </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> You can specify multiple KMIP servers as a comma-separated list, for example: <code class="leafygreen-ui-1l06pbn"> server1.example.com,server2.example.com </code> . On startup, the <code class="leafygreen-ui-1l06pbn"> mongod </code> attempts to establish a connection to each server in the order listed, and selects the first server to which it can successfully establish a connection. KMIP server selection occurs only at startup. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-KMIP-subject-alternative-name-CN"> </span> <p class="leafygreen-ui-1kp3ins"> When connecting to a KMIP server, the <code class="leafygreen-ui-1l06pbn"> mongod </code> verifies that the specified <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipServerName" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipServerName </code> </span> </a> matches the Subject Alternative Name <code class="leafygreen-ui-1l06pbn"> SAN </code> (or, if <code class="leafygreen-ui-1l06pbn"> SAN </code> is not present, the Common Name <code class="leafygreen-ui-1l06pbn"> CN </code> ) in the certificate presented by the KMIP server. If <code class="leafygreen-ui-1l06pbn"> SAN </code> is present, <code class="leafygreen-ui-1l06pbn"> mongod </code> does not match against the <code class="leafygreen-ui-1l06pbn"> CN </code> . If the hostname does not match the <code class="leafygreen-ui-1l06pbn"> SAN </code> (or <code class="leafygreen-ui-1l06pbn"> CN </code> ), the <code class="leafygreen-ui-1l06pbn"> mongod </code> fails to connect. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 4.2, when performing comparison of SAN, MongoDB supports comparison of DNS names or IP addresses. In previous versions, MongoDB only supports comparisons of DNS names. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --kmipPort &lt;number&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--kmipPort" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--kmipPort"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : 5696 </p> <p class="leafygreen-ui-1kp3ins"> Port number to use to communicate with the KMIP server. Requires <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipServerName" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipServerName </code> </span> </a> . Requires <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--enableEncryption" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --enableEncryption </code> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> If specifying multiple KMIP servers with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipServerName" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipServerName </code> </span> </a> , the <code class="leafygreen-ui-1l06pbn"> mongod </code> uses the port specified with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipPort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipPort </code> </span> </a> for all provided KMIP servers. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --kmipConnectRetries &lt;number&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--kmipConnectRetries" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--kmipConnectRetries"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : 0 </p> <p class="leafygreen-ui-1kp3ins"> How many times to retry the initial connection to the KMIP server. Use together with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipConnectTimeoutMS" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipConnectTimeoutMS </code> </span> </a> to control how long the <code class="leafygreen-ui-1l06pbn"> mongod </code> waits for a response between each retry. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --kmipConnectTimeoutMS &lt;number&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--kmipConnectTimeoutMS" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--kmipConnectTimeoutMS"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : 5000 </p> <p class="leafygreen-ui-1kp3ins"> Timeout in milliseconds to wait for a response from the KMIP server. If the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipConnectRetries" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipConnectRetries </code> </span> </a> setting is specified, the <code class="leafygreen-ui-1l06pbn"> mongod </code> waits for the specified interval between retries. </p> <p class="leafygreen-ui-1kp3ins"> Value must be <code class="leafygreen-ui-1l06pbn"> 1000 </code> or greater. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateSelector &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--kmipClientCertificateSelector" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--kmipClientCertificateSelector"> </div> </a> </dt> <dd> <div> <p> <em> New in version 5.0 </em> : Available on Windows and macOS as an alternative to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--kmipClientCertificateFile"> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateFile </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipClientCertificateFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateFile </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipClientCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateSelector </code> </span> </a> options are mutually exclusive. You can only specify one. </p> </div> <p class="leafygreen-ui-1kp3ins"> Specifies a certificate property in order to select a matching certificate from the operating system's certificate store to authenticate MongoDB to the KMIP server. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipClientCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateSelector </code> </span> </a> accepts an argument of the format <code class="leafygreen-ui-1l06pbn"> &lt;property&gt;=&lt;value&gt; </code> where the property can be one of the following: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width: 20%;"/> <col style="width: 20%;"/> <col style="width: 60%;"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Property </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Value type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> subject </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> ASCII string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Subject name or common name on certificate </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> thumbprint </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> hex string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> A sequence of bytes, expressed as hexadecimal, used to identify a public key by its SHA-1 digest. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> thumbprint </code> is sometimes referred to as a <code class="leafygreen-ui-1l06pbn"> fingerprint </code> . </p> </div> </div> </td> </tr> </tbody> </table> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateFile &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--kmipClientCertificateFile" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--kmipClientCertificateFile"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Path to the <code class="leafygreen-ui-1l06pbn"> .pem </code> file used to authenticate MongoDB to the KMIP server. The specified <code class="leafygreen-ui-1l06pbn"> .pem </code> file must contain both the TLS/SSL certificate and key. </p> <p class="leafygreen-ui-1kp3ins"> To use this option, you must also specify the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipServerName" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipServerName </code> </span> </a> option. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Enabling encryption using a KMIP server on Windows fails when using <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateFile </code> and the KMIP server enforces TLS 1.2. </p> <p class="leafygreen-ui-1kp3ins"> To enable encryption at rest with KMIP on Windows, you must: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Import the client certificate into the Windows Certificate Store. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipClientCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateSelector </code> </span> </a> option. </p> </li> </ul> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> On macOS or Windows, you can use a certificate from the operating system's secure store instead of a PEM key file. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipClientCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateSelector </code> . </span> </a> </p> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificatePassword &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--kmipClientCertificatePassword" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--kmipClientCertificatePassword"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The password (if one exists) for the client certificate passed into <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipClientCertificateFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateFile </code> </span> </a> . Is used for authenticating MongoDB to the KMIP server. Requires that a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipClientCertificateFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateFile </code> </span> </a> be provided. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --kmipServerCAFile &lt;string&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--kmipServerCAFile" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--kmipServerCAFile"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Path to CA File. Used for validating secure client connection to KMIP server. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> On macOS or Windows, you can use a certificate from the operating system's secure store instead of a PEM key file. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipClientCertificateSelector" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipClientCertificateSelector </code> </span> </a> . When using the secure store, you do not need to, but can, also specify the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipServerCAFile" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipServerCAFile </code> . </span> </a> </p> </div> </div> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --kmipActivateKeys &lt;boolean&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--kmipActivateKeys" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--kmipActivateKeys"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : true </p> <div> <p> <em> New in version 5.3 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Activates all newly created KMIP keys upon creation and then periodically checks those keys are in an active state. </p> <p class="leafygreen-ui-1kp3ins"> When <code class="leafygreen-ui-1l06pbn"> --kmipActivateKeys </code> is <code class="leafygreen-ui-1l06pbn"> true </code> and you have existing keys on a KMIP server, the key must be activated first or the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> node fails to start. </p> <p class="leafygreen-ui-1kp3ins"> If the key being used by the mongod transitions into a non-active state, the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-binary-bin.mongod" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongod </code> </span> </a> node shuts down unless <code class="leafygreen-ui-1l06pbn"> kmipActivateKeys </code> is false. To ensure you have an active key, rotate the KMIP master key by using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-option-mongod.--kmipRotateMasterKey" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> --kmipRotateMasterKey </code> . </span> </a> </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --kmipKeyStatePollingSeconds &lt;integer&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--kmipKeyStatePollingSeconds" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--kmipKeyStatePollingSeconds"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : 900 seconds </p> <div> <p> <em> New in version 5.3 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Frequency in seconds at which <code class="leafygreen-ui-1l06pbn"> mongod </code> polls the KMIP server for active keys. </p> <p class="leafygreen-ui-1kp3ins"> To disable disable polling, set the value to <code class="leafygreen-ui-1l06pbn"> -1 </code> . </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --kmipUseLegacyProtocol &lt;boolean&gt; </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--kmipUseLegacyProtocol" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--kmipUseLegacyProtocol"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Default </em> : false </p> <div> <p> <em> New in version 7.0 </em> : (and 6.0.6) </p> </div> <p class="leafygreen-ui-1kp3ins"> When <code class="leafygreen-ui-1l06pbn"> true </code> , <code class="leafygreen-ui-1l06pbn"> mongod </code> uses KMIP protocol version 1.0 or 1.1 instead of the default version. The default KMIP protocol is version 1.2. </p> <p class="leafygreen-ui-1kp3ins"> To use <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-encryption-at-rest/#std-label-security-encryption-at-rest-audit-log"> audit log encryption </a> with KMIP version 1.0 or 1.1, you must specify <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.auditEncryptKeyWithKMIPGet"> <code class="leafygreen-ui-1l06pbn"> auditEncryptKeyWithKMIPGet </code> </a> at startup. </p> </dd> </dl> <dl class="option"> <dt> <code class="leafygreen-ui-1l06pbn"> --eseDatabaseKeyRollover </code> <a class="headerlink leafygreen-ui-1kepx47" href="#std-option-mongod.--eseDatabaseKeyRollover" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="std-option-mongod.--eseDatabaseKeyRollover"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Roll over the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-encryption-at-rest/#std-label-encrypted-storage-engine"> encrypted storage engine </a> database keys configured with <code class="leafygreen-ui-1l06pbn"> AES256-GCM </code> cipher. </p> <p class="leafygreen-ui-1kp3ins"> When <code class="leafygreen-ui-1l06pbn"> mongod </code> instance is started with this option, the instance rotates the keys and exits. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Enterprise Feature </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Available in MongoDB Enterprise only. </p> </div> </div> </dd> </dl> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/replication/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Self-Managed Replication Reference <a class="headerlink leafygreen-ui-1kepx47" href="#self-managed-replication-reference" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="self-managed-replication-reference"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#replication-methods-in-mongosh" target="_self"> <span> Replication Methods in <code class="css-1kekw28 e1wawog0"> mongosh </code> </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#replication-database-commands" target="_self"> <span> Replication Database Commands </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#replica-set-reference-documentation" target="_self"> <span> Replica Set Reference Documentation </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Replication Methods in <code class="leafygreen-ui-1l06pbn"> mongosh </code> <a class="headerlink leafygreen-ui-1kepx47" href="#replication-methods-in-mongosh" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="replication-methods-in-mongosh"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.add/#mongodb-method-rs.add"> <code class="leafygreen-ui-1l06pbn"> rs.add() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds a member to a replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.addArb/#mongodb-method-rs.addArb"> <code class="leafygreen-ui-1l06pbn"> rs.addArb() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-arbiter"> arbiter </a> to a replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.conf/#mongodb-method-rs.conf"> <code class="leafygreen-ui-1l06pbn"> rs.conf() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the replica set configuration document. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.freeze/#mongodb-method-rs.freeze"> <code class="leafygreen-ui-1l06pbn"> rs.freeze() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prevents the current member from seeking election as primary for a period of time. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.help/#mongodb-method-rs.help"> <code class="leafygreen-ui-1l06pbn"> rs.help() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns basic help text for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> functions. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.initiate/#mongodb-method-rs.initiate"> <code class="leafygreen-ui-1l06pbn"> rs.initiate() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Initializes a new replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.printReplicationInfo/#mongodb-method-rs.printReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> rs.printReplicationInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prints a formatted report of the replica set status from the perspective of the primary. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.printSecondaryReplicationInfo/#mongodb-method-rs.printSecondaryReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> rs.printSecondaryReplicationInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prints a formatted report of the replica set status from the perspective of the secondaries. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.reconfig/#mongodb-method-rs.reconfig"> <code class="leafygreen-ui-1l06pbn"> rs.reconfig() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Re-configures a replica set by applying a new replica set configuration object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.remove/#mongodb-method-rs.remove"> <code class="leafygreen-ui-1l06pbn"> rs.remove() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Remove a member from a replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document with information about the state of the replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.stepDown/#mongodb-method-rs.stepDown"> <code class="leafygreen-ui-1l06pbn"> rs.stepDown() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Causes the current <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> to become a secondary which forces an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-election"> election <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.syncFrom/#mongodb-method-rs.syncFrom"> <code class="leafygreen-ui-1l06pbn"> rs.syncFrom() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Sets the member that this replica set member will sync from, overriding the default sync target selection logic. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Replication Database Commands <a class="headerlink leafygreen-ui-1kepx47" href="#replication-database-commands" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="replication-database-commands"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/applyOps/#mongodb-dbcommand-dbcmd.applyOps"> <code class="leafygreen-ui-1l06pbn"> applyOps </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Internal command that applies <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> entries to the current data set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hello/#mongodb-dbcommand-dbcmd.hello"> <code class="leafygreen-ui-1l06pbn"> hello </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Displays information about this member's role in the replica set, including whether it is the primary. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetAbortPrimaryCatchUp/#mongodb-dbcommand-dbcmd.replSetAbortPrimaryCatchUp"> <code class="leafygreen-ui-1l06pbn"> replSetAbortPrimaryCatchUp </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Forces the elected <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> to abort sync (catch up) then complete the transition to primary. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetFreeze/#mongodb-dbcommand-dbcmd.replSetFreeze"> <code class="leafygreen-ui-1l06pbn"> replSetFreeze </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prevents the current member from seeking election as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> for a period of time. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetGetConfig/#mongodb-dbcommand-dbcmd.replSetGetConfig"> <code class="leafygreen-ui-1l06pbn"> replSetGetConfig </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the replica set's configuration object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetGetStatus/#mongodb-dbcommand-dbcmd.replSetGetStatus"> <code class="leafygreen-ui-1l06pbn"> replSetGetStatus </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document that reports on the status of the replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetInitiate/#mongodb-dbcommand-dbcmd.replSetInitiate"> <code class="leafygreen-ui-1l06pbn"> replSetInitiate </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Initializes a new replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetMaintenance/#mongodb-dbcommand-dbcmd.replSetMaintenance"> <code class="leafygreen-ui-1l06pbn"> replSetMaintenance </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Enables or disables a maintenance mode, which puts a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondary </a> node in a <code class="leafygreen-ui-1l06pbn"> RECOVERING </code> state. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetReconfig/#mongodb-dbcommand-dbcmd.replSetReconfig"> <code class="leafygreen-ui-1l06pbn"> replSetReconfig </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Applies a new configuration to an existing replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetResizeOplog/#mongodb-dbcommand-dbcmd.replSetResizeOplog"> <code class="leafygreen-ui-1l06pbn"> replSetResizeOplog </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Dynamically resizes the oplog for a replica set member. Available for WiredTiger storage engine only. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetStepDown/#mongodb-dbcommand-dbcmd.replSetStepDown"> <code class="leafygreen-ui-1l06pbn"> replSetStepDown </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Forces the current <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> to <em> step down </em> and become a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondary </a> , forcing an election. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetSyncFrom/#mongodb-dbcommand-dbcmd.replSetSyncFrom"> <code class="leafygreen-ui-1l06pbn"> replSetSyncFrom </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Explicitly override the default logic for selecting a member to replicate from. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Replica Set Reference Documentation <a class="headerlink leafygreen-ui-1kepx47" href="#replica-set-reference-documentation" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="replica-set-reference-documentation"> </div> </a> </h2> <dl> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/"> Self-Managed Replica Set Configuration </a> </dt> <dd class="css-1ufxuu7"> Complete documentation of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> configuration object returned by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.conf/#mongodb-method-rs.conf"> <code class="leafygreen-ui-1l06pbn"> rs.conf() </code> . </a> </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-set-protocol-versions/"> Self-Managed Replica Set Protocol Version </a> </dt> <dd class="css-1ufxuu7"> Reference on the replica set protocol version. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/troubleshoot-replica-sets/"> Troubleshoot Replica Sets </a> </dt> <dd class="css-1ufxuu7"> Replica set trouble shooting guide. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/local-database/"> The <code class="leafygreen-ui-1l06pbn"> local </code> Database </a> </dt> <dd class="css-1ufxuu7"> Complete documentation of the content of the <code class="leafygreen-ui-1l06pbn"> local </code> database that <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances use to support replication. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-states/"> Replica Set Member States </a> </dt> <dd class="css-1ufxuu7"> Reference for the replica set member states. </dd> </dl> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/troubleshoot-reduce-function/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Troubleshoot the Reduce Function <a class="headerlink leafygreen-ui-1kepx47" href="#troubleshoot-the-reduce-function" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="troubleshoot-the-reduce-function"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#confirm-output-type" target="_self"> <span> Confirm Output Type </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#ensure-insensitivity-to-the-order-of-mapped-values" target="_self"> <span> Ensure Insensitivity to the Order of Mapped Values </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#ensure-reduce-function-idempotence" target="_self"> <span> Ensure Reduce Function Idempotence </span> </a> </li> </ul> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Aggregation Pipeline as Alternative to Map-Reduce </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/map-reduce/#std-label-map-reduce"> map-reduce </a> is deprecated: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Instead of <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/map-reduce/#std-label-map-reduce"> map-reduce </a> , you should use an <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/aggregation-pipeline/#std-label-aggregation-pipeline"> aggregation pipeline </a> . Aggregation pipelines provide better performance and usability than map-reduce. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can rewrite map-reduce operations using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation-pipeline/#std-label-aggregation-pipeline-operator-reference"> aggregation pipeline stages </a> , such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/merge/#mongodb-pipeline-pipe.-merge"> <code class="leafygreen-ui-1l06pbn"> $merge </code> </a> , and others. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For map-reduce operations that require custom functionality, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/accumulator/#mongodb-group-grp.-accumulator"> <code class="leafygreen-ui-1l06pbn"> $accumulator </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/function/#mongodb-expression-exp.-function"> <code class="leafygreen-ui-1l06pbn"> $function </code> </a> aggregation operators. You can use those operators to define custom aggregation expressions in JavaScript. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For examples of aggregation pipeline alternatives to map-reduce, see: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/map-reduce-to-aggregation-pipeline/"> Map-Reduce to Aggregation Pipeline </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/map-reduce-examples/"> Map-Reduce Examples </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> An <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/aggregation-pipeline/#std-label-aggregation-pipeline"> aggregation pipeline </a> is also easier to troubleshoot than a map-reduce operation. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> reduce </code> function is a JavaScript function that "reduces" to a single object all the values associated with a particular key during a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/map-reduce/#std-label-map-reduce"> map-reduce </a> operation. The <code class="leafygreen-ui-1l06pbn"> reduce </code> function must meet various requirements. This tutorial helps verify that the <code class="leafygreen-ui-1l06pbn"> reduce </code> function meets the following criteria: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> reduce </code> function must return an object whose <em> type </em> must be <strong> identical </strong> to the type of the <code class="leafygreen-ui-1l06pbn"> value </code> emitted by the <code class="leafygreen-ui-1l06pbn"> map </code> function. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The order of the elements in the <code class="leafygreen-ui-1l06pbn"> valuesArray </code> should not affect the output of the <code class="leafygreen-ui-1l06pbn"> reduce </code> function. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> reduce </code> function must be <em> idempotent </em> . </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For a list of all the requirements for the <code class="leafygreen-ui-1l06pbn"> reduce </code> function, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/mapReduce/#mongodb-dbcommand-dbcmd.mapReduce"> <code class="leafygreen-ui-1l06pbn"> mapReduce </code> </a> , or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> helper method <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.mapReduce/#mongodb-method-db.collection.mapReduce"> <code class="leafygreen-ui-1l06pbn"> db.collection.mapReduce() </code> . </a> </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Confirm Output Type <a class="headerlink leafygreen-ui-1kepx47" href="#confirm-output-type" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="confirm-output-type"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can test that the <code class="leafygreen-ui-1l06pbn"> reduce </code> function returns a value that is the same type as the value emitted from the <code class="leafygreen-ui-1l06pbn"> map </code> function. </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Define a <code class="leafygreen-ui-1l06pbn"> reduceFunction1 </code> function that takes the arguments <code class="leafygreen-ui-1l06pbn"> keyCustId </code> and <code class="leafygreen-ui-1l06pbn"> valuesPrices </code> . <code class="leafygreen-ui-1l06pbn"> valuesPrices </code> is an array of integers: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var reduceFunction1 = function(keyCustId, valuesPrices) {\n return Array.sum(valuesPrices);\n };","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> reduceFunction1 <!-- -->= <span class="lg-highlight-keyword lg-highlight-function">function</span>(<span class="lg-highlight-params">keyCustId, valuesPrices</span>)<!-- --> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">return</span> <span class="lg-highlight-title lg-highlight-class">Array</span>.<span class="lg-highlight-title lg-highlight-function">sum</span>(<!-- -->valuesPrices)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Define a sample array of integers: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var myTestValues = [ 5, 5, 10 ];","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> myTestValues <!-- -->= <!-- -->[ <span class="lg-highlight-number">5</span>, <span class="lg-highlight-number">5</span>, <span class="lg-highlight-number">10</span> ]<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Invoke the <code class="leafygreen-ui-1l06pbn"> reduceFunction1 </code> with <code class="leafygreen-ui-1l06pbn"> myTestValues </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"reduceFunction1('myKey', myTestValues);","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">reduceFunction1</span>(<span class="lg-highlight-string">'myKey'</span>, <!-- -->myTestValues)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Verify the <code class="leafygreen-ui-1l06pbn"> reduceFunction1 </code> returned an integer: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"20","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-number">20</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Define a <code class="leafygreen-ui-1l06pbn"> reduceFunction2 </code> function that takes the arguments <code class="leafygreen-ui-1l06pbn"> keySKU </code> and <code class="leafygreen-ui-1l06pbn"> valuesCountObjects </code> . <code class="leafygreen-ui-1l06pbn"> valuesCountObjects </code> is an array of documents that contain two fields <code class="leafygreen-ui-1l06pbn"> count </code> and <code class="leafygreen-ui-1l06pbn"> qty </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var reduceFunction2 = function(keySKU, valuesCountObjects) {\n reducedValue = { count: 0, qty: 0 };\n\n for (var idx = 0; idx &lt; valuesCountObjects.length; idx++) {\n reducedValue.count += valuesCountObjects[idx].count;\n reducedValue.qty += valuesCountObjects[idx].qty;\n }\n\n return reducedValue;\n };","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> reduceFunction2 <!-- -->= <span class="lg-highlight-keyword lg-highlight-function">function</span>(<span class="lg-highlight-params">keySKU, valuesCountObjects</span>)<!-- --> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->reducedValue <!-- -->= <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">0</span> }<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">for</span> <!-- -->(<span class="lg-highlight-keyword">var</span> idx <!-- -->= <span class="lg-highlight-number">0</span>; <!-- -->idx <!-- -->&lt; <!-- -->valuesCountObjects.<span class="lg-highlight-property">length</span>; <!-- -->idx<!-- -->+<!-- -->+<!-- -->) <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->reducedValue.<span class="lg-highlight-property">count</span> <!-- -->+<!-- -->= <!-- -->valuesCountObjects<!-- -->[<!-- -->idx].<span class="lg-highlight-property">count</span>;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->reducedValue.<span class="lg-highlight-property">qty</span> <!-- -->+<!-- -->= <!-- -->valuesCountObjects<!-- -->[<!-- -->idx].<span class="lg-highlight-property">qty</span>;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">return</span> <!-- -->reducedValue<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Define a sample array of documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var myTestObjects = [\n { count: 1, qty: 5 },\n { count: 2, qty: 10 },\n { count: 3, qty: 15 }\n ];","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> myTestObjects <!-- -->= <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">5</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">10</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">15</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Invoke the <code class="leafygreen-ui-1l06pbn"> reduceFunction2 </code> with <code class="leafygreen-ui-1l06pbn"> myTestObjects </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"reduceFunction2('myKey', myTestObjects);","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">reduceFunction2</span>(<span class="lg-highlight-string">'myKey'</span>, <!-- -->myTestObjects)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Verify the <code class="leafygreen-ui-1l06pbn"> reduceFunction2 </code> returned a document with exactly the <code class="leafygreen-ui-1l06pbn"> count </code> and the <code class="leafygreen-ui-1l06pbn"> qty </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"count\" : 6, \"qty\" : 30 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"count"</span> <!-- -->: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-string">"qty"</span> <!-- -->: <span class="lg-highlight-number">30</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ol> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Ensure Insensitivity to the Order of Mapped Values <a class="headerlink leafygreen-ui-1kepx47" href="#ensure-insensitivity-to-the-order-of-mapped-values" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="ensure-insensitivity-to-the-order-of-mapped-values"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> reduce </code> function takes a <code class="leafygreen-ui-1l06pbn"> key </code> and a <code class="leafygreen-ui-1l06pbn"> values </code> array as its argument. You can test that the result of the <code class="leafygreen-ui-1l06pbn"> reduce </code> function does not depend on the order of the elements in the <code class="leafygreen-ui-1l06pbn"> values </code> array. </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Define a sample <code class="leafygreen-ui-1l06pbn"> values1 </code> array and a sample <code class="leafygreen-ui-1l06pbn"> values2 </code> array that only differ in the order of the array elements: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var values1 = [\n { count: 1, qty: 5 },\n { count: 2, qty: 10 },\n { count: 3, qty: 15 }\n ];\n\nvar values2 = [\n { count: 3, qty: 15 },\n { count: 1, qty: 5 },\n { count: 2, qty: 10 }\n ];","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> values1 <!-- -->= <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">5</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">10</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">15</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> values2 <!-- -->= <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">15</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">5</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">10</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Define a <code class="leafygreen-ui-1l06pbn"> reduceFunction2 </code> function that takes the arguments <code class="leafygreen-ui-1l06pbn"> keySKU </code> and <code class="leafygreen-ui-1l06pbn"> valuesCountObjects </code> . <code class="leafygreen-ui-1l06pbn"> valuesCountObjects </code> is an array of documents that contain two fields <code class="leafygreen-ui-1l06pbn"> count </code> and <code class="leafygreen-ui-1l06pbn"> qty </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var reduceFunction2 = function(keySKU, valuesCountObjects) {\n reducedValue = { count: 0, qty: 0 };\n\n for (var idx = 0; idx &lt; valuesCountObjects.length; idx++) {\n reducedValue.count += valuesCountObjects[idx].count;\n reducedValue.qty += valuesCountObjects[idx].qty;\n }\n\n return reducedValue;\n };","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> reduceFunction2 <!-- -->= <span class="lg-highlight-keyword lg-highlight-function">function</span>(<span class="lg-highlight-params">keySKU, valuesCountObjects</span>)<!-- --> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->reducedValue <!-- -->= <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">0</span> }<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">for</span> <!-- -->(<span class="lg-highlight-keyword">var</span> idx <!-- -->= <span class="lg-highlight-number">0</span>; <!-- -->idx <!-- -->&lt; <!-- -->valuesCountObjects.<span class="lg-highlight-property">length</span>; <!-- -->idx<!-- -->+<!-- -->+<!-- -->) <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->reducedValue.<span class="lg-highlight-property">count</span> <!-- -->+<!-- -->= <!-- -->valuesCountObjects<!-- -->[<!-- -->idx].<span class="lg-highlight-property">count</span>;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->reducedValue.<span class="lg-highlight-property">qty</span> <!-- -->+<!-- -->= <!-- -->valuesCountObjects<!-- -->[<!-- -->idx].<span class="lg-highlight-property">qty</span>;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">return</span> <!-- -->reducedValue<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Invoke the <code class="leafygreen-ui-1l06pbn"> reduceFunction2 </code> first with <code class="leafygreen-ui-1l06pbn"> values1 </code> and then with <code class="leafygreen-ui-1l06pbn"> values2 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"reduceFunction2('myKey', values1);\nreduceFunction2('myKey', values2);","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">reduceFunction2</span>(<span class="lg-highlight-string">'myKey'</span>, <!-- -->values1)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">reduceFunction2</span>(<span class="lg-highlight-string">'myKey'</span>, <!-- -->values2)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Verify the <code class="leafygreen-ui-1l06pbn"> reduceFunction2 </code> returned the same result: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"count\" : 6, \"qty\" : 30 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"count"</span> <!-- -->: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-string">"qty"</span> <!-- -->: <span class="lg-highlight-number">30</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ol> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Ensure Reduce Function Idempotence <a class="headerlink leafygreen-ui-1kepx47" href="#ensure-reduce-function-idempotence" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="ensure-reduce-function-idempotence"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Because the map-reduce operation may call a <code class="leafygreen-ui-1l06pbn"> reduce </code> multiple times for the same key, and won't call a <code class="leafygreen-ui-1l06pbn"> reduce </code> for single instances of a key in the working set, the <code class="leafygreen-ui-1l06pbn"> reduce </code> function must return a value of the same type as the value emitted from the <code class="leafygreen-ui-1l06pbn"> map </code> function. You can test that the <code class="leafygreen-ui-1l06pbn"> reduce </code> function process "reduced" values without affecting the <em> final </em> value. </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Define a <code class="leafygreen-ui-1l06pbn"> reduceFunction2 </code> function that takes the arguments <code class="leafygreen-ui-1l06pbn"> keySKU </code> and <code class="leafygreen-ui-1l06pbn"> valuesCountObjects </code> . <code class="leafygreen-ui-1l06pbn"> valuesCountObjects </code> is an array of documents that contain two fields <code class="leafygreen-ui-1l06pbn"> count </code> and <code class="leafygreen-ui-1l06pbn"> qty </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var reduceFunction2 = function(keySKU, valuesCountObjects) {\n reducedValue = { count: 0, qty: 0 };\n\n for (var idx = 0; idx &lt; valuesCountObjects.length; idx++) {\n reducedValue.count += valuesCountObjects[idx].count;\n reducedValue.qty += valuesCountObjects[idx].qty;\n }\n\n return reducedValue;\n };","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> reduceFunction2 <!-- -->= <span class="lg-highlight-keyword lg-highlight-function">function</span>(<span class="lg-highlight-params">keySKU, valuesCountObjects</span>)<!-- --> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->reducedValue <!-- -->= <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">0</span> }<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">for</span> <!-- -->(<span class="lg-highlight-keyword">var</span> idx <!-- -->= <span class="lg-highlight-number">0</span>; <!-- -->idx <!-- -->&lt; <!-- -->valuesCountObjects.<span class="lg-highlight-property">length</span>; <!-- -->idx<!-- -->+<!-- -->+<!-- -->) <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->reducedValue.<span class="lg-highlight-property">count</span> <!-- -->+<!-- -->= <!-- -->valuesCountObjects<!-- -->[<!-- -->idx].<span class="lg-highlight-property">count</span>;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->reducedValue.<span class="lg-highlight-property">qty</span> <!-- -->+<!-- -->= <!-- -->valuesCountObjects<!-- -->[<!-- -->idx].<span class="lg-highlight-property">qty</span>;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">return</span> <!-- -->reducedValue<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Define a sample key: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var myKey = 'myKey';","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> myKey <!-- -->= <span class="lg-highlight-string">'myKey'</span>;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Define a sample <code class="leafygreen-ui-1l06pbn"> valuesIdempotent </code> array that contains an element that is a call to the <code class="leafygreen-ui-1l06pbn"> reduceFunction2 </code> function: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var valuesIdempotent = [\n { count: 1, qty: 5 },\n { count: 2, qty: 10 },\n reduceFunction2(myKey, [ { count:3, qty: 15 } ] )\n ];","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> valuesIdempotent <!-- -->= <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">5</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">10</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-function">reduceFunction2</span>(<!-- -->myKey<!-- -->, <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">count</span>:<span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">15</span> } ] )</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Define a sample <code class="leafygreen-ui-1l06pbn"> values1 </code> array that combines the values passed to <code class="leafygreen-ui-1l06pbn"> reduceFunction2 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var values1 = [\n { count: 1, qty: 5 },\n { count: 2, qty: 10 },\n { count: 3, qty: 15 }\n ];","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> values1 <!-- -->= <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">5</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">10</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">count</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">qty</span>: <span class="lg-highlight-number">15</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Invoke the <code class="leafygreen-ui-1l06pbn"> reduceFunction2 </code> first with <code class="leafygreen-ui-1l06pbn"> myKey </code> and <code class="leafygreen-ui-1l06pbn"> valuesIdempotent </code> and then with <code class="leafygreen-ui-1l06pbn"> myKey </code> and <code class="leafygreen-ui-1l06pbn"> values1 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"reduceFunction2(myKey, valuesIdempotent);\nreduceFunction2(myKey, values1);","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">reduceFunction2</span>(<!-- -->myKey<!-- -->, <!-- -->valuesIdempotent)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-function">reduceFunction2</span>(<!-- -->myKey<!-- -->, <!-- -->values1)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Verify the <code class="leafygreen-ui-1l06pbn"> reduceFunction2 </code> returned the same result: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"count\" : 6, \"qty\" : 30 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"count"</span> <!-- -->: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-string">"qty"</span> <!-- -->: <span class="lg-highlight-number">30</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ol> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/authenticate/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> authenticate <a class="headerlink leafygreen-ui-1kepx47" href="#authenticate" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="authenticate"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> </ul> </div> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> authenticate </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.authenticate" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-dbcommand-dbcmd.authenticate"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Authenticates using the x.509 authentication mechanism. When using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.auth/#mongodb-method-db.auth"> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </a> helper as follows: </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.auth( \"username\", passwordPrompt() )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">auth</span>( <span class="lg-highlight-string">"username"</span>, <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->) )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In earlier versions, to use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.auth/#mongodb-method-db.auth"> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </a> method, specify the password: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.auth( \"username\", \"password\" )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">auth</span>( <span class="lg-highlight-string">"username"</span>, <span class="lg-highlight-string">"password"</span> )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.auth/#mongodb-method-db.auth"> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/security/"> Security </a> </p> </li> </ul> </div> </div> </dd> </dl> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is not supported in M0, M2, and M5 clusters. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Client Disconnection <a class="headerlink leafygreen-ui-1kepx47" href="#client-disconnection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="client-disconnection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 4.2, if the client that issued <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.authenticate" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> authenticate </code> </span> </a> disconnects before the operation completes, MongoDB marks <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.authenticate" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> authenticate </code> </span> </a> for termination using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/killOp/#mongodb-dbcommand-dbcmd.killOp"> <code class="leafygreen-ui-1l06pbn"> killOp </code> . </a> </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/administration/self-managed-performance/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Self-Managed Performance <a class="headerlink leafygreen-ui-1kepx47" href="#self-managed-performance" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="self-managed-performance"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> Learn how to monitor and improve performance for self-managed deployments. </p> <dl> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/tcmalloc-performance/#std-label-tcmalloc-performance"> TCMalloc Performance Optimization </a> </dt> <dd class="css-1ufxuu7"> Learn how to use TCMalloc to reduce memory fragmentation and make your database more resilient to high-stress workloads. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/health-managers/#std-label-health-managers-overview"> Health Managers </a> </dt> <dd class="css-1ufxuu7"> Learn how to use <!-- --> Health Managers <!-- --> to monitor and manage sharded cluster health issues. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/ulimit/#std-label-ulimit"> UNIX ulimit Settings </a> </dt> <dd class="css-1ufxuu7"> Learn how to configure ulimit settings to control the use of system resources such as threads, files, and network connections. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/full-time-diagnostic-data-capture/#std-label-self-managed-ftdc"> Full Time Diagnostic Data Capture </a> </dt> <dd class="css-1ufxuu7"> Learn how MongoDB uses diagnostic data to analyze server behavior. </dd> </dl> </section>
https://www.mongodb.com/docs/manual/reference/operator/query/or/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $or <a class="headerlink leafygreen-ui-1kepx47" href="#-or" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-or"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behaviors" target="_self"> <span> Behaviors </span> </a> </li> </ul> </div> <dl class="query"> <dt> <code class="leafygreen-ui-1l06pbn"> $or </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-query-op.-or" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-query-op.-or"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> operator performs a logical <code class="leafygreen-ui-1l06pbn"> OR </code> operation on an array of <em> one or more </em> <code class="leafygreen-ui-1l06pbn"> &lt;expressions&gt; </code> and selects the documents that satisfy <em> at least </em> one of the <code class="leafygreen-ui-1l06pbn"> &lt;expressions&gt; </code> . </p> </dd> </dl> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can use <code class="leafygreen-ui-1l06pbn"> $or </code> for deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> operator has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $or: [ { &lt;expression1&gt; }, { &lt;expression2&gt; }, ... , { &lt;expressionn&gt; } ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$or</span>: <!-- -->[ <!-- -->{ &lt;<!-- -->expression1<!-- -->&gt; <!-- -->}<!-- -->, <!-- -->{ &lt;<!-- -->expression2<!-- -->&gt; <!-- -->}<!-- -->, <!-- -->...<!-- --> <!-- -->, <!-- -->{ &lt;<!-- -->expressionN<!-- -->&gt; <!-- -->} ] }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Consider the following example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find( { $or: [ { quantity: { $lt: 20 } }, { price: 10 } ] } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">$or</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">quantity</span>: <!-- -->{ <span class="lg-highlight-attr">$lt</span>: <span class="lg-highlight-number">20</span> } }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">10</span> } ] } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This query will select all documents in the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where either the <code class="leafygreen-ui-1l06pbn"> quantity </code> field value is less than <code class="leafygreen-ui-1l06pbn"> 20 </code> <strong> or </strong> the <code class="leafygreen-ui-1l06pbn"> price </code> field value equals <code class="leafygreen-ui-1l06pbn"> 10 </code> . </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behaviors <a class="headerlink leafygreen-ui-1kepx47" href="#behaviors" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behaviors"> </div> </a> </h2> <span class="leafygreen-ui-1qnjd6d" id="std-label-or-clauses-index"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> $or </code> Clauses and Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#-or-clauses-and-indexes" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-or-clauses-and-indexes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When evaluating the clauses in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> expression, MongoDB either performs a collection scan or, if all the clauses are supported by indexes, MongoDB performs index scans. That is, for MongoDB to use indexes to evaluate an <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> expression, all the clauses in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> expression must be supported by indexes. Otherwise, MongoDB will perform a collection scan. </p> <p class="leafygreen-ui-1kp3ins"> When using indexes with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> queries, each clause of an <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> can use its own index. Consider the following query: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find( { $or: [ { quantity: { $lt: 20 } }, { price: 10 } ] } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">$or</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">quantity</span>: <!-- -->{ <span class="lg-highlight-attr">$lt</span>: <span class="lg-highlight-number">20</span> } }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">10</span> } ] } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To support this query, rather than a compound index, you would create one index on <code class="leafygreen-ui-1l06pbn"> quantity </code> and another index on <code class="leafygreen-ui-1l06pbn"> price </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.createIndex( { quantity: 1 } )\ndb.inventory.createIndex( { price: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">1</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-or-and-text-queries"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> $or </code> and <code class="leafygreen-ui-1l06pbn"> text </code> Queries <a class="headerlink leafygreen-ui-1kepx47" href="#-or-and-text-queries" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-or-and-text-queries"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> includes a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/text/#mongodb-query-op.-text"> <code class="leafygreen-ui-1l06pbn"> $text </code> </a> query, all clauses in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> array must be supported by an index. This is because a <code class="leafygreen-ui-1l06pbn"> $text </code> query <em> must </em> use an index, and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> can only use indexes if all its clauses are supported by indexes. If the <code class="leafygreen-ui-1l06pbn"> $text </code> query cannot use an index, the query will return an error. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $text </code> provides text query capabilities for self-managed (non-Atlas) deployments. For data hosted on MongoDB Atlas, MongoDB offers an improved full-text query solution, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/" target="_self"> <span> Atlas Search <!-- --> . </span> </a> </p> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> $or </code> and GeoSpatial Queries <a class="headerlink leafygreen-ui-1kepx47" href="#-or-and-geospatial-queries" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-or-and-geospatial-queries"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> supports <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query-geospatial/"> geospatial clauses </a> with the following exception for the near clause (near clause includes <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/nearSphere/#mongodb-query-op.-nearSphere"> <code class="leafygreen-ui-1l06pbn"> $nearSphere </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/near/#mongodb-query-op.-near"> <code class="leafygreen-ui-1l06pbn"> $near </code> </a> ). <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> cannot contain a near clause with any other clause. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> $or </code> and Sort Operations <a class="headerlink leafygreen-ui-1kepx47" href="#-or-and-sort-operations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-or-and-sort-operations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When executing <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> queries with a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.sort/#mongodb-method-cursor.sort"> <code class="leafygreen-ui-1l06pbn"> sort() </code> </a> , MongoDB can use indexes that support the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> clauses. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> $or </code> and Partial Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#-or-and-partial-indexes" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-or-and-partial-indexes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can create <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-partial/#std-label-index-type-partial"> partial indexes </a> with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> . Use the <code class="leafygreen-ui-1l06pbn"> partialFilterExpression </code> of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#std-label-method-createIndex"> db.collection.createIndex() </a> method to create a partial index. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> $or </code> versus <code class="leafygreen-ui-1l06pbn"> $in </code> <a class="headerlink leafygreen-ui-1kepx47" href="#-or-versus--in" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-or-versus--in"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> with <code class="leafygreen-ui-1l06pbn"> &lt;expressions&gt; </code> that are equality checks for the value of the same field, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/in/#mongodb-query-op.-in"> <code class="leafygreen-ui-1l06pbn"> $in </code> </a> operator instead of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> operator. </p> <p class="leafygreen-ui-1kp3ins"> For example, to select all documents in the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where the <code class="leafygreen-ui-1l06pbn"> quantity </code> field value equals either <code class="leafygreen-ui-1l06pbn"> 20 </code> <em> or </em> <code class="leafygreen-ui-1l06pbn"> 50 </code> , use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/in/#mongodb-query-op.-in"> <code class="leafygreen-ui-1l06pbn"> $in </code> </a> operator: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find ( { quantity: { $in: [20, 50] } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-property">find</span> <!-- -->( <!-- -->{ <span class="lg-highlight-attr">quantity</span>: <!-- -->{ <span class="lg-highlight-attr">$in</span>: <!-- -->[<span class="lg-highlight-number">20</span>, <span class="lg-highlight-number">50</span>] } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Nested <code class="leafygreen-ui-1l06pbn"> $or </code> Clauses <a class="headerlink leafygreen-ui-1kepx47" href="#nested--or-clauses" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="nested--or-clauses"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You may nest <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-or" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $or </code> </span> </a> operations. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/and/#mongodb-query-op.-and"> <code class="leafygreen-ui-1l06pbn"> $and </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.sort/#mongodb-method-cursor.sort"> <code class="leafygreen-ui-1l06pbn"> sort() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/in/#mongodb-query-op.-in"> <code class="leafygreen-ui-1l06pbn"> $in </code> </a> </p> </li> </ul> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Error Handling <a class="headerlink leafygreen-ui-1kepx47" href="#error-handling" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="error-handling"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To allow the query engine to optimize queries, <code class="leafygreen-ui-1l06pbn"> $or </code> handles errors as follows: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If any expression supplied to <code class="leafygreen-ui-1l06pbn"> $or </code> would cause an error when evaluated alone, the <code class="leafygreen-ui-1l06pbn"> $or </code> containing the expression may cause an error but an error is not guaranteed. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> An expression supplied after the first expression supplied to <code class="leafygreen-ui-1l06pbn"> $or </code> may cause an error even if the first expression evaluates to <code class="leafygreen-ui-1l06pbn"> true </code> . </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For example, the following query <em> always </em> produces an error if <code class="leafygreen-ui-1l06pbn"> $x </code> is <code class="leafygreen-ui-1l06pbn"> 0 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.example.find( {\n $expr: { $eq: [ { $divide: [ 1, \"$x\" ] }, 3 ] }\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">example</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$expr</span>: <!-- -->{ <span class="lg-highlight-attr">$eq</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">$divide</span>: <!-- -->[ <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"$x"</span> ] }<!-- -->, <span class="lg-highlight-number">3</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following query, which contains multiple expressions supplied to <code class="leafygreen-ui-1l06pbn"> $or </code> , <em> may </em> produce an error if there is any document where <code class="leafygreen-ui-1l06pbn"> $x </code> is <code class="leafygreen-ui-1l06pbn"> 0 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.example.find( {\n $or: [\n { x: { $eq: 0 } },\n { $expr: { $eq: [ { $divide: [ 1, \"$x\" ] }, 3 ] } }\n ]\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">example</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$or</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">x</span>: <!-- -->{ <span class="lg-highlight-attr">$eq</span>: <span class="lg-highlight-number">0</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$expr</span>: <!-- -->{ <span class="lg-highlight-attr">$eq</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">$divide</span>: <!-- -->[ <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"$x"</span> ] }<!-- -->, <span class="lg-highlight-number">3</span> ] } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/rs.syncFrom/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> rs.syncFrom() <a class="headerlink leafygreen-ui-1kepx47" href="#rs.syncfrom--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="rs.syncfrom--"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> rs.syncFrom() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-rs.syncFrom" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-rs.syncFrom"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Temporarily overrides the default sync target for the current member. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> mongosh Method </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page documents a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> method. This is <em> not </em> the documentation for database commands or language-specific drivers, such as Node.js. </p> <p class="leafygreen-ui-1kp3ins"> For the database command, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetFreeze/#mongodb-dbcommand-dbcmd.replSetFreeze"> <code class="leafygreen-ui-1l06pbn"> replSetFreeze </code> </a> command <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB API drivers, refer to the language-specific <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB driver documentation <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Specify the name of the member you want to replicate from in the form of <code class="leafygreen-ui-1l06pbn"> [hostname]:[port] </code> . </p> </dd> </dl> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sync Logic <a class="headerlink leafygreen-ui-1kepx47" href="#sync-logic" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sync-logic"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If an initial sync operation is in progress when you run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetSyncFrom/#mongodb-dbcommand-dbcmd.replSetSyncFrom"> <code class="leafygreen-ui-1l06pbn"> replSetSyncFrom </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetSyncFrom/#mongodb-dbcommand-dbcmd.replSetSyncFrom"> <code class="leafygreen-ui-1l06pbn"> replSetSyncFrom </code> </a> stops the in-progress initial sync and restarts the sync process with the new target. </p> <p class="leafygreen-ui-1kp3ins"> Only modify the default sync logic as needed, and always exercise caution. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Target <a class="headerlink leafygreen-ui-1kepx47" href="#target" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="target"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The member to sync from must be a valid source for data in the set. To sync from a member, the member must: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Have data. It cannot be an arbiter, in startup or recovering mode, and must be able to answer data queries. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Be accessible. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Be a member of the same set in the replica set configuration. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Build indexes with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-.buildIndexes"> <code class="leafygreen-ui-1l06pbn"> members[n].buildIndexes </code> </a> setting. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A different member of the set, to prevent syncing from itself. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If you attempt to replicate from a member that is more than 10 seconds behind the current member, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> will log a warning but will still replicate from the lagging member. See also <a class="leafygreen-ui-tqgtui" href="/docs/manual/replication/#std-label-replication-flow-control"> Replication Lag and Flow Control <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Persistence <a class="headerlink leafygreen-ui-1kepx47" href="#persistence" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="persistence"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetSyncFrom/#mongodb-dbcommand-dbcmd.replSetSyncFrom"> <code class="leafygreen-ui-1l06pbn"> replSetSyncFrom </code> </a> provide a temporary override of default behavior. <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> will revert to the default sync behavior in the following situations: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance restarts. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The connection between the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and the sync target closes. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the sync target falls more than 30 seconds behind another member of the replica set. </p> </li> </ul> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-rs.syncFrom" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> rs.syncFrom() </code> </span> </a> helper in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> : </span> </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"rs.syncFrom(\"myHost:27017\");","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">syncFrom</span>(<span class="lg-highlight-string">"myHost:27017"</span>)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetSyncFrom/#mongodb-dbcommand-dbcmd.replSetSyncFrom"> <code class="leafygreen-ui-1l06pbn"> replSetSyncFrom </code> </a> </p> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/core/auditing/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Auditing Self-Managed Deployments <a class="headerlink leafygreen-ui-1kepx47" href="#auditing-self-managed-deployments" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="auditing-self-managed-deployments"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#enable-and-configure-audit-output" target="_self"> <span> Enable and Configure Audit Output </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#audit-events-and-filter" target="_self"> <span> Audit Events and Filter </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#audit-guarantee" target="_self"> <span> Audit Guarantee </span> </a> </li> </ul> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Auditing in MongoDB Atlas </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB Atlas supports auditing for <code class="leafygreen-ui-1l06pbn"> M10 </code> and larger clusters. To learn more, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/database-auditing/#std-label-set-up-database-auditing" target="_self"> <span> Set Up Database Auditing </span> </a> in the MongoDB Atlas documentation. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB Enterprise includes an auditing capability for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances. The auditing facility allows administrators and users to track system activity for deployments with multiple users and applications. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Enable and Configure Audit Output <a class="headerlink leafygreen-ui-1kepx47" href="#enable-and-configure-audit-output" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="enable-and-configure-audit-output"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The auditing facility can write audit events to the console, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-syslog"> syslog </a> , a JSON file, or a BSON file. To enable auditing in MongoDB Enterprise, set an audit output destination with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--auditDestination"> <code class="leafygreen-ui-1l06pbn"> --auditDestination </code> </a> . For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-auditing/"> Configure Auditing on Self-Managed Deployments <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> For information on the audit log messages, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/"> System Event Audit Messages in Self-Managed Deployments <!-- --> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-auditing-audit-events-and-filter"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Audit Events and Filter <a class="headerlink leafygreen-ui-1kepx47" href="#audit-events-and-filter" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="audit-events-and-filter"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Once enabled, the auditing system can record the following operations <a class="footnote-reference header-buffer" href="#footnote-transactions" id="ref-transactions-id1"> [ <!-- --> 1 <!-- --> ] </a> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> schema (DDL), </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> replica set and sharded cluster, </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> authentication and authorization, and </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> CRUD operations (requires <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.auditAuthorizationSuccess"> <code class="leafygreen-ui-1l06pbn"> auditAuthorizationSuccess </code> </a> set to <code class="leafygreen-ui-1l06pbn"> true </code> ). </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondaries </a> do not log DDL audit events for replicated changes. DDL audit events are still logged for DDL operations that modify the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/local-database/#std-label-replica-set-local-database"> local database </a> and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/system-collections/#mongodb-data--database-.system.profile"> <code class="leafygreen-ui-1l06pbn"> system.profile </code> </a> collection. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For details on audited actions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/audit-message/#std-label-audit-message-format"> System Event Audit Messages in Self-Managed Deployments <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> With the auditing system, you can <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-audit-filters/#std-label-audit-filter"> set up filters </a> to restrict the events captured. To set up filters, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-audit-filters/"> Configure Audit Filters on Self-Managed Deployments <!-- --> . </a> </p> <table class="header-buffer leafygreen-ui-rbqgrl" frame="void" id="footnote-transactions" rules="none"> <colgroup> <col/> </colgroup> <tbody valign="top"> <tr> <td class="leafygreen-ui-17r2xs0"> [ <a href="#ref-transactions-id1"> 1 </a> ] </td> <td class="leafygreen-ui-17r2xs0"> <!-- --> Operations in an aborted transaction still generate audit events. However, there is no audit event that indicates that the transaction aborted. </td> </tr> </tbody> </table> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Audit Guarantee <a class="headerlink leafygreen-ui-1kepx47" href="#audit-guarantee" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="audit-guarantee"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The auditing system writes every audit event <a class="footnote-reference header-buffer" href="#footnote-filter" id="ref-filter-id2"> [ <!-- --> 2 <!-- --> ] </a> to an in-memory buffer of audit events. MongoDB writes this buffer to disk periodically. For events collected from any single connection, the events have a total order: if MongoDB writes one event to disk, the system guarantees that it has written all prior events for that connection to disk. </p> <p class="leafygreen-ui-1kp3ins"> If an audit event entry corresponds to an operation that affects the durable state of the database, such as a modification to data, MongoDB will always write the audit event to disk <em> before </em> writing to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-journal"> journal </a> for that entry. </p> <p class="leafygreen-ui-1kp3ins"> That is, before adding an operation to the journal, MongoDB writes all audit events on the connection that triggered the operation, up to and including the entry for the operation. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB may lose events <strong> if </strong> the server terminates before it commits the events to the audit log. The client may receive confirmation of the event before MongoDB commits to the audit log. For example, while auditing an aggregation operation, the server might terminate after returning the result but before the audit log flushes. </p> <p class="leafygreen-ui-1kp3ins"> In addition, if the server cannot write to the audit log at the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--auditDestination"> <code class="leafygreen-ui-1l06pbn"> audit destination </code> </a> , the server will terminate. </p> </div> </div> <table class="header-buffer leafygreen-ui-rbqgrl" frame="void" id="footnote-filter" rules="none"> <colgroup> <col/> </colgroup> <tbody valign="top"> <tr> <td class="leafygreen-ui-17r2xs0"> [ <a href="#ref-filter-id2"> 2 </a> ] </td> <td class="leafygreen-ui-17r2xs0"> <!-- --> Audit configuration can include a <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-audit-filters/#std-label-audit-filter"> filter </a> to limit events to audit. </td> </tr> </tbody> </table> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/Bulk.getOperations/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Bulk.getOperations() <a class="headerlink leafygreen-ui-1kepx47" href="#bulk.getoperations--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="bulk.getoperations--"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#example" target="_self"> <span> Example </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#returned-fields" target="_self"> <span> Returned Fields </span> </a> </li> </ul> </div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> Bulk.getOperations() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-Bulk.getOperations" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-Bulk.getOperations"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Returns an array of write operations executed through <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.execute/#mongodb-method-Bulk.execute"> <code class="leafygreen-ui-1l06pbn"> Bulk.execute() </code> </a> . The returned write operations are in groups as determined by MongoDB for execution. For information on how MongoDB groups the list of bulk write operations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.execute/#std-label-bulk-execute-behavior"> Bulk.execute() Behavior <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Only use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-Bulk.getOperations" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> Bulk.getOperations() </code> </span> </a> after a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.execute/#mongodb-method-Bulk.execute"> <code class="leafygreen-ui-1l06pbn"> Bulk.execute() </code> </a> . Calling <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-Bulk.getOperations" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> Bulk.getOperations() </code> </span> </a> before you call <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.execute/#mongodb-method-Bulk.execute"> <code class="leafygreen-ui-1l06pbn"> Bulk.execute() </code> </a> will result in an <em> incomplete </em> list. </p> </dd> </dl> <span class="leafygreen-ui-1qnjd6d" id="std-label-bulk-getOperations-example"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following initializes a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> operations builder on the <code class="leafygreen-ui-1l06pbn"> items </code> collection, adds a series of write operations, executes the operations, and then calls <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-Bulk.getOperations" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> getOperations() </code> </span> </a> on the <code class="leafygreen-ui-1l06pbn"> bulk </code> builder object: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"var bulk = db.items.initializeUnorderedBulkOp();\n\nfor (var i = 1; i &lt;= 1500; i++) {\n bulk.insert( { x: i } );\n}\n\nbulk.execute();\nbulk.getOperations();","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">var</span> bulk <!-- -->= <!-- -->db.<span class="lg-highlight-property">items</span>.<span class="lg-highlight-title lg-highlight-function">initializeUnorderedBulkOp</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">for</span> <!-- -->(<span class="lg-highlight-keyword">var</span> i <!-- -->= <span class="lg-highlight-number">1</span>; <!-- -->i <!-- -->&lt;= <span class="lg-highlight-number">1500</span>; <!-- -->i<!-- -->+<!-- -->+<!-- -->) <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->bulk.<span class="lg-highlight-title lg-highlight-function">insert</span>( <!-- -->{ <span class="lg-highlight-attr">x</span>: <!-- -->i } )<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">bulk.<span class="lg-highlight-title lg-highlight-function">execute</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">bulk.<span class="lg-highlight-title lg-highlight-function">getOperations</span>(<!-- -->)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-Bulk.getOperations" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> getOperations() </code> </span> </a> method returns an array with the operations executed. The output shows that MongoDB divided the operations into 2 groups, one with 1000 operations and one with 500. For information on how MongoDB groups the list of bulk write operations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.execute/#std-label-bulk-execute-behavior"> Bulk.execute() Behavior </a> </p> <p class="leafygreen-ui-1kp3ins"> Although the method returns all 1500 operations in the returned array, this page omits some of the results for brevity. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n {\n \"originalZeroIndex\" : 0,\n \"batchType\" : 1,\n \"operations\" : [\n { \"_id\" : ObjectId(\"53a8959f1990ca24d01c6165\"), \"x\" : 1 },\n\n ... // Content omitted for brevity\n\n { \"_id\" : ObjectId(\"53a8959f1990ca24d01c654c\"), \"x\" : 1000 }\n ]\n },\n {\n \"originalZeroIndex\" : 1000,\n \"batchType\" : 1,\n \"operations\" : [\n { \"_id\" : ObjectId(\"53a8959f1990ca24d01c654d\"), \"x\" : 1001 },\n\n ... // Content omitted for brevity\n\n { \"_id\" : ObjectId(\"53a8959f1990ca24d01c6740\"), \"x\" : 1500 }\n ]\n }\n]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"originalZeroIndex"</span> <!-- -->: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"batchType"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"operations"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"53a8959f1990ca24d01c6165"</span>)<!-- -->, <span class="lg-highlight-string">"x"</span> <!-- -->: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...<!-- --> <span class="lg-highlight-comment">//</span><span class="lg-highlight-comment"> Content omitted for </span><span class="lg-highlight-comment">brevity</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"53a8959f1990ca24d01c654c"</span>)<!-- -->, <span class="lg-highlight-string">"x"</span> <!-- -->: <span class="lg-highlight-number">1000</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"originalZeroIndex"</span> <!-- -->: <span class="lg-highlight-number">1000</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"batchType"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"operations"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"53a8959f1990ca24d01c654d"</span>)<!-- -->, <span class="lg-highlight-string">"x"</span> <!-- -->: <span class="lg-highlight-number">1001</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...<!-- --> <span class="lg-highlight-comment">//</span><span class="lg-highlight-comment"> Content omitted for </span><span class="lg-highlight-comment">brevity</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"53a8959f1990ca24d01c6740"</span>)<!-- -->, <span class="lg-highlight-string">"x"</span> <!-- -->: <span class="lg-highlight-number">1500</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Returned Fields <a class="headerlink leafygreen-ui-1kepx47" href="#returned-fields" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="returned-fields"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The array contains documents with the following fields: </p> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> originalZeroIndex </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-originalZeroIndex" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-originalZeroIndex"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the order in which the operation was added to the bulk operations builder, based on a zero index; e.g. first operation added to the bulk operations builder will have <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-originalZeroIndex" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> originalZeroIndex </code> </span> </a> value of <code class="leafygreen-ui-1l06pbn"> 0 </code> . </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> batchType </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-batchType" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-batchType"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Specifies the write operations type. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> <code class="leafygreen-ui-1l06pbn"> batchType </code> </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Operation </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 1 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Insert </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 2 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Update </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> 3 </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Remove </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> operations </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-operations" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-operations"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Array of documents that contain the details of the operation. </p> </dd> </dl> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.execute/#mongodb-method-Bulk.execute"> <code class="leafygreen-ui-1l06pbn"> Bulk.execute() </code> </a> </p> </li> </ul> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/core/sharding-set-missing-shard-key-fields/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Set Missing Shard Key Fields <a class="headerlink leafygreen-ui-1kepx47" href="#set-missing-shard-key-fields" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="set-missing-shard-key-fields"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> If you have missing shard key fields, you can set the shard key field to <code class="leafygreen-ui-1l06pbn"> null </code> . If you want to set the missing shard key field to a non- <code class="leafygreen-ui-1l06pbn"> null </code> value, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-change-shard-key-value/#std-label-update-shard-key"> Change a Document's Shard Key Value <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To perform the update, you can use the following operations on a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> : </a> </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:60%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Command </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Method </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/update/#std-label-command-update-shard-key-modification"> update </a> with </div> <div class="line"> <code class="leafygreen-ui-1l06pbn"> multi: true </code> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateMany/#std-label-updateMany-sharded-collection"> db.collection.updateMany() </a> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Can be used to set the missing key value to <code class="leafygreen-ui-1l06pbn"> null </code> only. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Can be performed inside or outside a transaction. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Can be performed as a retryable write or not. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For additional requirements, refer to the specific command/method. </p> </li> </ul> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/update/#std-label-command-update-shard-key-modification"> update </a> with </div> <div class="line"> <code class="leafygreen-ui-1l06pbn"> multi: false </code> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.replaceOne/#std-label-replaceOne-missing-shard-key"> db.collection.replaceOne() </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#std-label-updateOne-missing-shard-key"> db.collection.updateOne() </a> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Can be used to set the missing key value to <code class="leafygreen-ui-1l06pbn"> null </code> or any other value. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The update to set missing shard key fields <strong> must </strong> meet one of the following requirements: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the filter of the query contains an equality condition on the full shard key in the query </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the filter of the query contains an exact match on _id </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the update targets a single shard </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To set to a non- <code class="leafygreen-ui-1l06pbn"> null </code> value, refer to <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-change-shard-key-value/#std-label-update-shard-key"> Change a Document's Shard Key Value <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For additional requirements, refer to the specific command/method. </p> </li> </ul> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/findAndModify/#std-label-cmd-findAndModify-missing-shard-key"> findAndModify </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findOneAndReplace/#std-label-findOneAndReplace-missing-shard-key"> db.collection.findOneAndReplace() </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findOneAndUpdate/#std-label-findOneAndUpdate-missing-shard-key"> db.collection.findOneAndUpdate() </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findAndModify/#std-label-method-findAndModify-missing-shard-key"> db.collection.findAndModify() </a> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Can be used to set the missing key value to <code class="leafygreen-ui-1l06pbn"> null </code> or any other value. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When setting missing shard key fields with a method that explicitly updates only one document, the update <strong> must </strong> meet one of the following requirements: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the filter of the query contains an equality condition on the full shard key in the query </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the filter of the query contains an exact match on _id </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the update targets a single shard </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Missing key values are returned when matching on <code class="leafygreen-ui-1l06pbn"> null </code> . To avoid updating a key value that is <code class="leafygreen-ui-1l06pbn"> null </code> , include additional query conditions as appropriate. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To set to a non- <code class="leafygreen-ui-1l06pbn"> null </code> value, refer to <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-change-shard-key-value/#std-label-update-shard-key"> Change a Document's Shard Key Value <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For additional requirements, refer to the specific command/method. </p> </li> </ul> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.bulkWrite/#mongodb-method-db.collection.bulkWrite"> <code class="leafygreen-ui-1l06pbn"> db.collection.bulkWrite() </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.replaceOne/#mongodb-method-Bulk.find.replaceOne"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.replaceOne() </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.updateOne/#mongodb-method-Bulk.find.updateOne"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.updateOne() </code> </a> </div> <div class="line"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.update/#mongodb-method-Bulk.find.update"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.update() </code> </a> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To set to a <code class="leafygreen-ui-1l06pbn"> null </code> value, you can specify multiple shard key modifications in the bulk operation. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When setting missing shard key fields with a method that explicitly updates only one document, the update <strong> must </strong> meet one of the following requirements: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the filter of the query contains an equality condition on the full shard key in the query </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the filter of the query contains an exact match on _id </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the update targets a single shard </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To set to a non- <code class="leafygreen-ui-1l06pbn"> null </code> value, refer to <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-change-shard-key-value/#std-label-update-shard-key"> Change a Document's Shard Key Value <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For additional requirements, refer to the underlying command/method. </p> </li> </ul> </div> </div> </td> </tr> </tbody> </table> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Consider a <code class="leafygreen-ui-1l06pbn"> sales </code> collection which is sharded on the <code class="leafygreen-ui-1l06pbn"> location </code> field. Some documents in the collection have no <code class="leafygreen-ui-1l06pbn"> location </code> field. A missing field is considered the same as a null value for the field. To explicitly set these fields to <code class="leafygreen-ui-1l06pbn"> null </code> , run the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.sales.updateOne(\n { _id: 12345, location: null },\n { $set: { location: null } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">sales</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">12345</span>, <span class="lg-highlight-attr">location</span>: <span class="lg-highlight-literal">null</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$set</span>: <!-- -->{ <span class="lg-highlight-attr">location</span>: <span class="lg-highlight-literal">null</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> When setting missing shard key fields with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#mongodb-method-db.collection.updateOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.updateOne() </code> </a> or another method that explicitly updates only one document, the update <strong> must </strong> meet one of the following requirements: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the filter of the query contains an equality condition on the full shard key in the query </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the filter of the query contains an exact match on _id </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the update targets a single Shard </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/connection-string-examples/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Connection String Examples <a class="headerlink leafygreen-ui-1kepx47" href="#connection-string-examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="connection-string-examples"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#mongodb-atlas-deployment-connection-string-examples" target="_self"> <span> MongoDB Atlas Deployment Connection String Examples </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#mongodb-atlas-cluster-that-authenticates-with-a-username-and-password" target="_self"> <span> MongoDB Atlas Cluster that Authenticates with a Username and Password </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#mongodb-atlas-cluster-that-authenticates-with-aws-iam-credentials" target="_self"> <span> MongoDB Atlas Cluster that Authenticates with AWS IAM credentials </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#self-hosted-deployment-connection-string-examples" target="_self"> <span> Self-Hosted Deployment Connection String Examples </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#self-hosted-cluster-that-authenticates-with-a-username-and-password" target="_self"> <span> Self-Hosted Cluster that Authenticates with a Username and Password </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#self-hosted-database-server-running-locally" target="_self"> <span> Self-Hosted Database Server Running Locally </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#self-hosted-admin-database-running-locally" target="_self"> <span> Self-Hosted <code class="css-1kekw28 e1wawog0"> admin </code> Database Running Locally </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#self-hosted-records-database-running-locally" target="_self"> <span> Self-Hosted <code class="css-1kekw28 e1wawog0"> records </code> Database Running Locally </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#self-hosted-unix-domain-socket" target="_self"> <span> Self-Hosted UNIX Domain Socket </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#self-hosted-replica-set-with-members-on-different-machines" target="_self"> <span> Self-Hosted Replica Set with Members on Different Machines </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#self-hosted-replica-set-with-members-on-localhost" target="_self"> <span> Self-Hosted Replica Set with Members on <code class="css-1kekw28 e1wawog0"> localhost </code> </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#self-hosted-replica-set-with-read-distribution" target="_self"> <span> Self-Hosted Replica Set with Read Distribution </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#self-hosted-replica-set-with-a-high-level-of-write-concern" target="_self"> <span> Self-Hosted Replica Set with a High Level of Write Concern </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#self-hosted-sharded-cluster" target="_self"> <span> Self-Hosted Sharded Cluster </span> </a> </li> </ul> </div> <hr class="css-1unva0n e4ru7ww0"/> <p class="leafygreen-ui-1kp3ins"> ➤ <!-- --> Use the <strong> Select your language </strong> drop-down menu in the upper-right to set the language of the following examples. </p> <hr class="css-1unva0n e4ru7ww0"/> <p class="leafygreen-ui-1kp3ins"> You can use connection strings to define connections between MongoDB instances and the following destinations: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your applications when you connect using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> drivers <!-- --> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Tools such as <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/compass/current/" target="_self"> <span> MongoDB Compass </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/" target="_self"> <span> the MongoDB Shell (mongosh) <!-- --> . </span> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> This page provides example URI strings for common connection targets. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> MongoDB Atlas Deployment Connection String Examples <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-atlas-deployment-connection-string-examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-atlas-deployment-connection-string-examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example connection strings connect to an MongoDB Atlas deployment. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> MongoDB Atlas Cluster that Authenticates with a Username and Password <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-atlas-cluster-that-authenticates-with-a-username-and-password" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-atlas-cluster-that-authenticates-with-a-username-and-password"> </div> </a> </h3> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-6"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_v8pgdcl65" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ui26ybr9r" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_50ut66akb" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_4bi6psvb0" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_46yon51cz" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_v2aya06cq" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_8meh4jeju" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_m1mur37hq" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_u7c6l39eb" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_trex15jkd" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_ghdx3dxdt" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_7m81c1qxn" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_za2bk4de1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0vr771yq8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_9jgdeaht7" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_7ou6gu5lb" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_ynnl70r1w" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_h886nu231" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_z2bn182fy" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ojctlqade" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_ub1j6dmjo" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_izc4x0wag" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_3f9zn2hos" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9g7te0d1r" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_3imcniilv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_6gmt88ct6" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_4sukaant0" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_c5ls3qrrt" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_536t06884" class="leafygreen-ui-38lglc" id="_05gioaz5p" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb+srv://cluster0.example.mongodb.net myFirstDatabase\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb+srv://cluster0.example.mongodb.net myFirstDatabase"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-40-menu" aria-describedby="select-40-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-41" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11c:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11c:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11c:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11c:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_s32ztz9pj" class="leafygreen-ui-38lglc" id="_vv5xsad08" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-43-menu" aria-describedby="select-43-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-44" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11d:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11d:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11d:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11d:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_npch0p6gj" class="leafygreen-ui-38lglc" id="_84ocs8bdy" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-46-menu" aria-describedby="select-46-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-47" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11e:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11e:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11e:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11e:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_m38v0tvwn" class="leafygreen-ui-38lglc" id="_iqw36iykf" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-49-menu" aria-describedby="select-49-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-50" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11f:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11f:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11f:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11f:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_vfe263bek" class="leafygreen-ui-38lglc" id="_ohphtyyqz" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-52-menu" aria-describedby="select-52-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-53" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11g:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11g:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11g:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11g:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_y6op9mq5x" class="leafygreen-ui-38lglc" id="_t89ipbqu8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-55-menu" aria-describedby="select-55-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-56" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11h:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11h:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11h:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11h:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_5mf8hvwaa" class="leafygreen-ui-38lglc" id="_3ol13jyyi" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-58-menu" aria-describedby="select-58-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-59" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11i:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11i:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11i:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11i:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_4086s0dx7" class="" id="_419cac8fk" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-61-menu" aria-describedby="select-61-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-62" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11j:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11j:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11j:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11j:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_avj80buo3" class="leafygreen-ui-38lglc" id="_yhixrijd5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-64-menu" aria-describedby="select-64-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-65" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11k:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11k:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11k:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11k:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_53tjzkiuv" class="leafygreen-ui-38lglc" id="_eouujoivw" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-67-menu" aria-describedby="select-67-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-68" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11l:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11l:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11l:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11l:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_p4h92oolg" class="leafygreen-ui-38lglc" id="_30313gg2q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-70-menu" aria-describedby="select-70-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-71" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11m:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11m:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11m:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11m:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_2tzqzktoe" class="leafygreen-ui-38lglc" id="_396hkgs5x" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-73-menu" aria-describedby="select-73-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-74" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11n:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11n:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11n:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11n:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_wymdbn0fq" class="leafygreen-ui-38lglc" id="_vpao1j960" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-76-menu" aria-describedby="select-76-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-77" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11o:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11o:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11o:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11o:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_xz4ah0w3r" class="leafygreen-ui-38lglc" id="_bd4gs94mr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?retryWrites=true&amp;w=majority</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-79-menu" aria-describedby="select-79-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-80" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11p:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11p:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11p:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11p:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-connections-string-example-mongodb-aws"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> MongoDB Atlas Cluster that Authenticates with AWS IAM credentials <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-atlas-cluster-that-authenticates-with-aws-iam-credentials" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-atlas-cluster-that-authenticates-with-aws-iam-credentials"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following connects to a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/atlas/database?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> cluster which has been configured to support authentication via <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html" rel="noopener noreferrer"> <span> AWS IAM credentials <!-- --> : </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-8"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_fjdbb18e6" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0i3ddmnzk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_0esdmkpx0" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_phsscq6go" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_y3byy8hyg" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_gjbxrkanq" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_vz76r8rgc" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_v7agd9b1d" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_hqtxonwf9" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_jo5ijzvwg" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_t7mhurrdn" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_x00736zcq" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_z8atki8gc" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ec2n5v3fb" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_p19a3lab1" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_ndi833boi" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_i7dmqrewl" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_1qofkxk7l" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_7lvhj8szj" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_p5o2266z8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_0qspb573z" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9o2vldmkr" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_zz32806qe" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0zjucrje2" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_g5mdh968k" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_xdgfqmj9k" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_z5za0ffue" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5lnawwqov" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_igujkl8no" class="leafygreen-ui-38lglc" id="_uqjpa89er" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh 'mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS'","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">'mongodb+srv://&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS'</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-82-menu" aria-describedby="select-82-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-83" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11q:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11q:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11q:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11q:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_43ceiwa67" class="leafygreen-ui-38lglc" id="_04wdykdlz" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-85-menu" aria-describedby="select-85-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-86" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11r:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11r:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11r:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11r:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_xe2nsn3jb" class="leafygreen-ui-38lglc" id="_0td2amp5n" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-88-menu" aria-describedby="select-88-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-89" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11s:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11s:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11s:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11s:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_5pywn2ra0" class="leafygreen-ui-38lglc" id="_nykcru96x" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-91-menu" aria-describedby="select-91-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-92" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11t:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11t:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11t:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11t:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_qwftah2il" class="leafygreen-ui-38lglc" id="_88adeqg00" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-94-menu" aria-describedby="select-94-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-95" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11u:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11u:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11u:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11u:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_9s1r5wl9z" class="leafygreen-ui-38lglc" id="_z5799h2cn" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-97-menu" aria-describedby="select-97-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-98" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r11v:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r11v:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11v:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r11v:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_0au4fnjko" class="leafygreen-ui-38lglc" id="_vz83sxdri" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-100-menu" aria-describedby="select-100-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-101" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r120:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r120:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r120:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r120:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_0l6x12s5q" class="" id="_qux6wlxiu" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-103-menu" aria-describedby="select-103-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-104" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r121:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r121:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r121:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r121:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_4l7hip4mz" class="leafygreen-ui-38lglc" id="_zs8xea6is" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-106-menu" aria-describedby="select-106-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-107" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r122:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r122:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r122:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r122:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_wpic5p7h9" class="leafygreen-ui-38lglc" id="_2cvw556b4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-109-menu" aria-describedby="select-109-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-110" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r123:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r123:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r123:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r123:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_7jtgq0sv5" class="leafygreen-ui-38lglc" id="_ux8gadzrw" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-112-menu" aria-describedby="select-112-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-113" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r124:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r124:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r124:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r124:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_xok9vle87" class="leafygreen-ui-38lglc" id="_tfyi6wz34" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-115-menu" aria-describedby="select-115-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-116" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r125:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r125:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r125:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r125:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_9fb43hjt1" class="leafygreen-ui-38lglc" id="_pt8yno08j" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-118-menu" aria-describedby="select-118-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-119" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r126:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r126:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r126:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r126:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_dncdrsiko" class="leafygreen-ui-38lglc" id="_6mjfjd9n9" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-121-menu" aria-describedby="select-121-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-122" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r127:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r127:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r127:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r127:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Connecting to Atlas using AWS IAM credentials in this manner uses the <code class="leafygreen-ui-1l06pbn"> MONGODB-AWS </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string-options/#mongodb-urioption-urioption.authMechanism"> <code class="leafygreen-ui-1l06pbn"> authentication mechanism </code> </a> and the <code class="leafygreen-ui-1l06pbn"> $external </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string-options/#mongodb-urioption-urioption.authSource"> <code class="leafygreen-ui-1l06pbn"> authSource </code> </a> , as shown in this example. </p> <p class="leafygreen-ui-1kp3ins"> If using an <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html" rel="noopener noreferrer"> <span> AWS session token </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> , as well, provide it with the <code class="leafygreen-ui-1l06pbn"> AWS_SESSION_TOKEN </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string-options/#mongodb-urioption-urioption.authMechanismProperties"> <code class="leafygreen-ui-1l06pbn"> authMechanismProperties </code> </a> value, as follows: </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-9"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_ncrfbahjs" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5sda48f6e" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_ss01l1tpm" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_3cj4zy4n3" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_i5iynuu95" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fwj7cmpc9" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_z60mx10tv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_7zxpyiodu" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_2vr5jps33" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_nyehkqj23" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_50j6nfhcx" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2bn05qep1" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_frsh916ap" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_hr8gjht3k" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_omu3jy8mp" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_3i9vo5yoh" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_3ximew5zs" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_8xmh73jd1" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_ueplusyeh" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_n9t5r2wv4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_6iuzadaoq" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2f9c9bfqm" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_5ogg8fhvg" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_i4nn8xm5v" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_9r47ouqld" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_zwk522526" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_fc0wb6mr6" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_wm8lxr8ri" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_fndz3nmkq" class="leafygreen-ui-38lglc" id="_6h4r7v8jk" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh 'mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;'","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">'mongodb+srv://&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;'</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-124-menu" aria-describedby="select-124-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-125" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r128:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r128:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r128:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r128:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_h8nn7vsyk" class="leafygreen-ui-38lglc" id="_xq6emm5m6" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-127-menu" aria-describedby="select-127-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-128" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r129:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r129:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r129:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r129:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_b4z96z8v2" class="leafygreen-ui-38lglc" id="_pu2dlh0tf" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-130-menu" aria-describedby="select-130-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-131" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12a:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12a:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12a:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12a:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_x3e1nvb9z" class="leafygreen-ui-38lglc" id="_j68upqauy" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-133-menu" aria-describedby="select-133-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-134" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12b:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12b:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12b:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12b:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_xfsuhkksl" class="leafygreen-ui-38lglc" id="_b593erve0" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-136-menu" aria-describedby="select-136-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-137" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12c:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12c:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12c:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12c:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_vxg6d1api" class="leafygreen-ui-38lglc" id="_vqg16aumz" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-139-menu" aria-describedby="select-139-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-140" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12d:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12d:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12d:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12d:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_jtvolnvlz" class="leafygreen-ui-38lglc" id="_813ophfgu" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-142-menu" aria-describedby="select-142-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-143" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12e:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12e:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12e:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12e:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_hcvrtply1" class="" id="_5byh6rlng" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-145-menu" aria-describedby="select-145-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-146" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12f:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12f:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12f:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12f:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_5ee9im292" class="leafygreen-ui-38lglc" id="_k1q8aa3na" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-148-menu" aria-describedby="select-148-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-149" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12g:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12g:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12g:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12g:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_b65wo364e" class="leafygreen-ui-38lglc" id="_f5uomzci5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-151-menu" aria-describedby="select-151-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-152" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12h:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12h:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12h:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12h:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_nqd4ees2d" class="leafygreen-ui-38lglc" id="_7bqfo6995" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-154-menu" aria-describedby="select-154-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-155" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12i:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12i:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12i:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12i:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_8t872j4m2" class="leafygreen-ui-38lglc" id="_oj0yc0geg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-157-menu" aria-describedby="select-157-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-158" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12j:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12j:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12j:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12j:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_cfxu4l7t2" class="leafygreen-ui-38lglc" id="_9s5pqh3yf" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-160-menu" aria-describedby="select-160-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-161" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12k:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12k:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12k:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12k:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_9jdey2lrw" class="leafygreen-ui-38lglc" id="_0irhlwzh4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://&lt;aws&gt;:&lt;aws&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//&lt;aws access key id&gt;:&lt;aws secret access key&gt;@cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS&amp;authMechanismProperties=AWS_SESSION_TOKEN:&lt;aws session token&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-163-menu" aria-describedby="select-163-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-164" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12l:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12l:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12l:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12l:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If the AWS access key ID, the secret access key, or the session token include the following characters: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$ : / ? # [ ] @"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$ : / ? # [ ] @</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> those characters must be converted using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc3986#section-2.1" rel="noopener noreferrer"> <span> percent encoding <!-- --> . </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> You may also set these credentials on your platform using standard <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html#envvars-list" rel="noopener noreferrer"> <span> AWS IAM environment variables </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> . <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> checks for the following environment variables when you use the <code class="leafygreen-ui-1l06pbn"> MONGODB-AWS </code> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string-options/#mongodb-urioption-urioption.authMechanism"> <code class="leafygreen-ui-1l06pbn"> authentication mechanism </code> : </a> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> AWS_ACCESS_KEY_ID </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> AWS_SECRET_ACCESS_KEY </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> AWS_SESSION_TOKEN </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If set, these credentials do not need to be specified in the connection string. </p> <p class="leafygreen-ui-1kp3ins"> The following example sets these environment variables in the <code class="leafygreen-ui-1l06pbn"> bash </code> shell: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"export AWS_ACCESS_KEY_ID='&lt;aws&gt;'\nexport AWS_SECRET_ACCESS_KEY='&lt;aws&gt;'\nexport AWS_SESSION_TOKEN='&lt;aws&gt;'"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">export AWS_ACCESS_KEY_ID='&lt;aws access key id&gt;'</td></tr><tr class=""><td class="leafygreen-ui-7razhx">export AWS_SECRET_ACCESS_KEY='&lt;aws secret access key&gt;'</td></tr><tr class=""><td class="leafygreen-ui-7razhx">export AWS_SESSION_TOKEN='&lt;aws session token&gt;'</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Syntax for setting environment variables in other shells will be different. Consult the documentation for your platform for more information. </p> <p class="leafygreen-ui-1kp3ins"> You can verify that these environment variables have been set with the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"env | grep AWS"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">env | grep AWS</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Once set, the following example connects to a MongoDB Atlas cluster using these environment variables: </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-10"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_2ac7sz3t8" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_n4unkvhlu" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_tkn88rvfc" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5yx9o5p55" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_uvx4y1r8l" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_pylwzis4r" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_t0iwkg8ni" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_vmiyi7in5" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_9eytcg5om" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_gdg4g3hve" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_ln7stig4u" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_6rndoemrj" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_0kyqmaw1h" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9b18xnce1" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_zlz4z5mhm" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_l7xvix9u2" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_2a1l3wcu1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_1x63wpi7s" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_dgjaedl92" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_jtmyrhbid" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_u1hsrrw5t" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_dlgcmirt6" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_r16hs78ku" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_i1ahz0c9b" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_tm68m07pc" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_z682waw75" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_5i2rz5wxd" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_4wiia957o" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_2asrvgid2" class="leafygreen-ui-38lglc" id="_5vuafy1wl" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh 'mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS'","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">'mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS'</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-168-menu" aria-describedby="select-168-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-169" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12m:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12m:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12m:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12m:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_wdwo5t2wj" class="leafygreen-ui-38lglc" id="_snu3tca71" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><!-- --><span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-171-menu" aria-describedby="select-171-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-172" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12n:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12n:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12n:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12n:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_4ljp5hwxo" class="leafygreen-ui-38lglc" id="_esakrzwqr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><!-- --><span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-174-menu" aria-describedby="select-174-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-175" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12o:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12o:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12o:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12o:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_czwe9h9la" class="leafygreen-ui-38lglc" id="_is586686a" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><!-- --><span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-177-menu" aria-describedby="select-177-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-178" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12p:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12p:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12p:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12p:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_x91vof08d" class="leafygreen-ui-38lglc" id="_vr37hv60i" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><!-- --><span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-180-menu" aria-describedby="select-180-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-181" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12q:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12q:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12q:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12q:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_z7iv8fgh3" class="leafygreen-ui-38lglc" id="_55dhf1m39" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><!-- --><span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-183-menu" aria-describedby="select-183-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-184" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12r:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12r:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12r:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12r:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_9s7631tcx" class="leafygreen-ui-38lglc" id="_7wivp1aoo" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><!-- --><span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-186-menu" aria-describedby="select-186-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-187" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12s:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12s:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12s:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12s:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ul2ajaw0l" class="" id="_nfleunykx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><!-- --><span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-189-menu" aria-describedby="select-189-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-190" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12t:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12t:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12t:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12t:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_s8zn11c8q" class="leafygreen-ui-38lglc" id="_b2aj5p2i8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><!-- --><span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-192-menu" aria-describedby="select-192-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-193" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12u:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12u:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12u:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12u:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_feuty2eow" class="leafygreen-ui-38lglc" id="_i4o8b9a1l" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><!-- --><span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-195-menu" aria-describedby="select-195-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-196" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r12v:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r12v:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12v:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r12v:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_n7gi0hl11" class="leafygreen-ui-38lglc" id="_1o9snm0e0" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><!-- --><span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-198-menu" aria-describedby="select-198-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-199" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r130:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r130:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r130:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r130:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_2x0jh459u" class="leafygreen-ui-38lglc" id="_zbexcm8vt" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><!-- --><span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-201-menu" aria-describedby="select-201-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-202" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r131:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r131:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r131:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r131:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_yjdu55xnx" class="leafygreen-ui-38lglc" id="_ajf65murt" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><!-- --><span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-204-menu" aria-describedby="select-204-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-205" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r132:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r132:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r132:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r132:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ulort9tuu" class="leafygreen-ui-38lglc" id="_8zocu6i3i" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><!-- --><span class="lg-highlight-attr">srv</span>:<!-- --><span class="lg-highlight-comment">//cluster0.example.com/testdb?authSource=$external&amp;authMechanism=MONGODB-AWS</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-207-menu" aria-describedby="select-207-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-208" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r133:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r133:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r133:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r133:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Self-Hosted Deployment Connection String Examples <a class="headerlink leafygreen-ui-1kepx47" href="#self-hosted-deployment-connection-string-examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="self-hosted-deployment-connection-string-examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example connection strings connect to a self-hosted deployment. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Self-Hosted Cluster that Authenticates with a Username and Password <a class="headerlink leafygreen-ui-1kepx47" href="#self-hosted-cluster-that-authenticates-with-a-username-and-password" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="self-hosted-cluster-that-authenticates-with-a-username-and-password"> </div> </a> </h3> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-21"> <div aria-label="Tabs to describe usage of srv/standard" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_xjmjjvmel" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_e5v4p41pu" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> SRV Connection String </div> </button> <button aria-controls="_0s3x6b7dz" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_pfkfp53hy" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Standard Connection String </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_p0xdd3mts" class="" id="_bke3jwwoh" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-16"> <div aria-label="Tabs to describe usage of repl/sharded/standalone" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_jwmgoa1hf" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_gt1txlpho" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Replica Set </div> </button> <button aria-controls="_i05cny4ff" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5w7pt4tfo" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Sharded Cluster </div> </button> <button aria-controls="_9d57r6yj0" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_d26pvxrk8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Standalone </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_oud4nbvdn" class="" id="_1dlkebmcn" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following replica set connection string includes these elements: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string-options/#mongodb-urioption-urioption.replicaSet"> <code class="leafygreen-ui-1l06pbn"> replicaSet </code> </a> option </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The hostname(s) of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance(s) as listed in the replica set configuration </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> It authenticates as user <code class="leafygreen-ui-1l06pbn"> myDatabaseUser </code> with the password <code class="leafygreen-ui-1l06pbn"> D1fficultP%40ssw0rd </code> to <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/enable-authentication/#std-label-enable-access-control"> enforce access control </a> </p> </li> </ul> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-13"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_jo03mwgrz" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ohuzu5b0w" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_nlsc6duvy" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_vhey1ehrb" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_dor7ja40i" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_k74w2nsre" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_9z1cbcmkp" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_pnikwqtsz" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_8ut78gm7q" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2io0rfw7m" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_xx9ovcurm" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_cobferso3" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_46sn6plcr" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tpm6enviy" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_aezwal0n3" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_hvee9nxlx" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_nhygdhp2n" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2y6n5nqp4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_dhwjzzxnh" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_aih3gbm3z" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_zrg1i1bby" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_gxglp2w6i" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_mkdwotozw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_zwqil9ibp" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_ym8fl56ba" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_z7o3336iz" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_am3djfzla" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_4lf1fb1yf" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_dn30lobam" class="leafygreen-ui-38lglc" id="_habczbz1i" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb+srv://mongodb0.example.com/?authSource=admin&amp;replicaSet=myRepl\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb+srv://mongodb0.example.com/?authSource=admin&amp;replicaSet=myRepl"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-210-menu" aria-describedby="select-210-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-211" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r134:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r134:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r134:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r134:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_u11n8mq5m" class="leafygreen-ui-38lglc" id="_h4k8vhem8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-213-menu" aria-describedby="select-213-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-214" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r135:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r135:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r135:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r135:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_z6pbmyoyi" class="leafygreen-ui-38lglc" id="_5it8u67db" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-216-menu" aria-describedby="select-216-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-217" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r136:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r136:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r136:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r136:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_df10569wo" class="leafygreen-ui-38lglc" id="_zhsai44e4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-219-menu" aria-describedby="select-219-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-220" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r137:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r137:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r137:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r137:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_hic9r9ihk" class="leafygreen-ui-38lglc" id="_ofn6w6cys" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-222-menu" aria-describedby="select-222-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-223" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r138:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r138:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r138:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r138:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_0lrvuxx5h" class="leafygreen-ui-38lglc" id="_xnm1li5uj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-225-menu" aria-describedby="select-225-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-226" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r139:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r139:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r139:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r139:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_opgfifmfh" class="leafygreen-ui-38lglc" id="_8xwxne2q2" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-228-menu" aria-describedby="select-228-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-229" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13a:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13a:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13a:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13a:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_aiw10ckiq" class="" id="_yggyv0ryq" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-231-menu" aria-describedby="select-231-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-232" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13b:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13b:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13b:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13b:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_qvqw1xo23" class="leafygreen-ui-38lglc" id="_0zyuc36lx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-234-menu" aria-describedby="select-234-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-235" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13c:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13c:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13c:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13c:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_uivpasyss" class="leafygreen-ui-38lglc" id="_hfe9zomk9" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-237-menu" aria-describedby="select-237-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-238" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13d:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13d:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13d:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13d:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_t52xejl78" class="leafygreen-ui-38lglc" id="_dhfjea0lg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-240-menu" aria-describedby="select-240-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-241" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13e:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13e:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13e:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13e:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_dagy1u3py" class="leafygreen-ui-38lglc" id="_i0z2r3aez" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-243-menu" aria-describedby="select-243-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-244" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13f:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13f:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13f:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13f:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_3tl8ml79l" class="leafygreen-ui-38lglc" id="_c5776ax21" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-246-menu" aria-describedby="select-246-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-247" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13g:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13g:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13g:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13g:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_7eyjidrs4" class="leafygreen-ui-38lglc" id="_4dmld6chx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-249-menu" aria-describedby="select-249-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-250" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13h:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13h:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13h:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13h:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If the username or password includes the following characters, those characters must be converted using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc3986#section-2.1" rel="noopener noreferrer"> <span> percent encoding <!-- --> : </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$ : / ? # [ ] @"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$ : / ? # [ ] @</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_esaci3eol" class="leafygreen-ui-38lglc" id="_p3jvcde4c" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following sharded cluster connection string includes the these elements: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> hosts in the connection string </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> It authenticates as user <code class="leafygreen-ui-1l06pbn"> myDatabaseUser </code> with the password <code class="leafygreen-ui-1l06pbn"> D1fficultP%40ssw0rd </code> to <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/enable-authentication/#std-label-enable-access-control"> enforce access control </a> </p> </li> </ul> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-14"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_2qh17c530" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_bpkalyug7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_lojhlax8g" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lzx82o0wo" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_zdqyrj7hf" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lnrxoqoxt" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_rcej9bhlv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tto2djja4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_7tlpfrx1b" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_xn9j9l3im" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_qjl69mlwy" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fax963cm4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_c3argnrlt" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_yd9dfkalz" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_5o23ffppf" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_2g2dt9mkg" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_dt4ca2qg3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_v5jnr0akg" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_li8evtjl1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ukiph72cs" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_sjwlk2olk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_whskwd77k" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_8wm9xxh29" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_7ptz4euy6" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_j0jewf9bk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tcwqbcelc" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_fw826yio4" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_u5shdazhu" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_g7gde9omh" class="leafygreen-ui-38lglc" id="_b6udazeo1" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb+srv://mongos0.example.com/?authSource=admin\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb+srv://mongos0.example.com/?authSource=admin"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-252-menu" aria-describedby="select-252-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-253" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13i:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13i:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13i:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13i:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_rd7gcdxgp" class="leafygreen-ui-38lglc" id="_2x3dxgcyf" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-255-menu" aria-describedby="select-255-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-256" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13j:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13j:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13j:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13j:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_3l0bphg3f" class="leafygreen-ui-38lglc" id="_mcnf4uxpy" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-258-menu" aria-describedby="select-258-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-259" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13k:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13k:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13k:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13k:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_hizggj6w8" class="leafygreen-ui-38lglc" id="_7icvqlzbr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-261-menu" aria-describedby="select-261-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-262" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13l:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13l:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13l:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13l:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_bftdlr37q" class="leafygreen-ui-38lglc" id="_5ojx3rekq" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-264-menu" aria-describedby="select-264-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-265" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13m:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13m:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13m:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13m:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_9gxug528x" class="leafygreen-ui-38lglc" id="_5ibbbrwjn" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-267-menu" aria-describedby="select-267-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-268" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13n:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13n:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13n:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13n:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_kwzxs8dw3" class="leafygreen-ui-38lglc" id="_nnjxo5tut" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-270-menu" aria-describedby="select-270-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-271" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13o:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13o:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13o:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13o:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_b8r8k9ph1" class="" id="_d9jae2x2y" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-273-menu" aria-describedby="select-273-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-274" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13p:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13p:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13p:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13p:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_y8zappwub" class="leafygreen-ui-38lglc" id="_xbktofj65" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-276-menu" aria-describedby="select-276-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-277" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13q:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13q:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13q:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13q:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_zdap2jr9w" class="leafygreen-ui-38lglc" id="_whawo3ef2" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-279-menu" aria-describedby="select-279-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-280" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13r:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13r:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13r:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13r:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ynx6irswa" class="leafygreen-ui-38lglc" id="_g0vt56muv" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-282-menu" aria-describedby="select-282-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-283" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13s:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13s:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13s:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13s:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_7j8e42vni" class="leafygreen-ui-38lglc" id="_l6tm1gq5p" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-285-menu" aria-describedby="select-285-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-286" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13t:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13t:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13t:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13t:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_j8792i7rk" class="leafygreen-ui-38lglc" id="_jx51y4nl4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-288-menu" aria-describedby="select-288-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-289" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13u:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13u:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13u:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13u:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_sn50qkzvn" class="leafygreen-ui-38lglc" id="_rcurcy4it" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-291-menu" aria-describedby="select-291-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-292" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r13v:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r13v:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13v:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r13v:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If the username or password includes the following characters, those characters must be converted using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc3986#section-2.1" rel="noopener noreferrer"> <span> percent encoding <!-- --> : </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$ : / ? # [ ] @"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$ : / ? # [ ] @</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_7n6n8dbod" class="leafygreen-ui-38lglc" id="_6b43gfzix" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following standalone connection string authenticates as user <code class="leafygreen-ui-1l06pbn"> myDatabaseUser </code> with the password <code class="leafygreen-ui-1l06pbn"> D1fficultP%40ssw0rd </code> to <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/enable-authentication/#std-label-enable-access-control"> enforce access control <!-- --> : </a> </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-15"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_5qb43rn6r" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_m2vyllu7c" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_pjlxs062u" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9fk1bumik" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_tb2swb3wc" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_zjoqkynsr" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_ovmhxdb20" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_34auabed8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_x0ushp6b4" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tgqejtme4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_g6nqisd4f" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_jistkb30r" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_4pvov28d1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_7ka130lmk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_z7rag74sx" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_o07pv3bak" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_nef9oykw3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_f1tes36sk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_s5nzf4y9x" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ccs7gxfi5" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_qwbkl3ugj" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_jyeout9lj" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_vscond7w8" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5x50xu1t5" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_x2fe82trk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tezrnjcl9" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_ukaxzp9sm" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0efjov5wv" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_siy9pwkhq" class="leafygreen-ui-38lglc" id="_wu6w36m4u" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb+srv://mongodb0.example.com/?authSource=admin\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb+srv://mongodb0.example.com/?authSource=admin"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-294-menu" aria-describedby="select-294-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-295" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r140:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r140:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r140:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r140:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_z880vxnwx" class="leafygreen-ui-38lglc" id="_h7lo040h7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-297-menu" aria-describedby="select-297-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-298" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r141:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r141:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r141:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r141:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_oaz0w7zms" class="leafygreen-ui-38lglc" id="_3gy55dpjo" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-300-menu" aria-describedby="select-300-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-301" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r142:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r142:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r142:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r142:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_8308uybfo" class="leafygreen-ui-38lglc" id="_2yqobio2z" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-303-menu" aria-describedby="select-303-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-304" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r143:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r143:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r143:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r143:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_hqatemab5" class="leafygreen-ui-38lglc" id="_19j1yef2h" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-306-menu" aria-describedby="select-306-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-307" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r144:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r144:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r144:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r144:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_eucjb3yo1" class="leafygreen-ui-38lglc" id="_50ated8mu" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-309-menu" aria-describedby="select-309-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-310" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r145:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r145:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r145:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r145:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_cm14bxcc5" class="leafygreen-ui-38lglc" id="_63j9p8ndh" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-312-menu" aria-describedby="select-312-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-313" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r146:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r146:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r146:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r146:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_wfhkbg3ub" class="" id="_3pmq5asdk" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-315-menu" aria-describedby="select-315-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-316" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r147:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r147:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r147:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r147:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_jl5is7ozm" class="leafygreen-ui-38lglc" id="_5fnft24m5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-318-menu" aria-describedby="select-318-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-319" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r148:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r148:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r148:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r148:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_pw9rp0anb" class="leafygreen-ui-38lglc" id="_jatrsgjdu" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-321-menu" aria-describedby="select-321-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-322" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r149:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r149:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r149:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r149:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_cvpbhnf8b" class="leafygreen-ui-38lglc" id="_bek4xaxqd" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-324-menu" aria-describedby="select-324-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-325" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14a:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14a:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14a:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14a:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_rfuzeqnf1" class="leafygreen-ui-38lglc" id="_hxl97inev" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-327-menu" aria-describedby="select-327-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-328" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14b:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14b:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14b:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14b:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_tfvjwqe83" class="leafygreen-ui-38lglc" id="_nt1xaa04t" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-330-menu" aria-describedby="select-330-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-331" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14c:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14c:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14c:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14c:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_c52wcgrhz" class="leafygreen-ui-38lglc" id="_3z3643w4m" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb+srv://myDatabaseUser:D1fficultP%[email protected]/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongodb<!-- -->+<!-- --><span class="lg-highlight-attr">srv</span>:<span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-333-menu" aria-describedby="select-333-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-334" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14d:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14d:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14d:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14d:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If the username or password includes the following characters, those characters must be converted using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc3986#section-2.1" rel="noopener noreferrer"> <span> percent encoding <!-- --> : </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$ : / ? # [ ] @"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$ : / ? # [ ] @</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ywpsv58qn" class="leafygreen-ui-38lglc" id="_5ihyv6eqv" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-20"> <div aria-label="Tabs to describe usage of repl/sharded/standalone" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_q13gtuhe8" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_xi6jvknmv" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Replica Set </div> </button> <button aria-controls="_0y6ypqxn1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_p7xc1bdoc" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Sharded Cluster </div> </button> <button aria-controls="_zsjulx5ay" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0pe7sev8x" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Standalone </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_ebhzv5jij" class="" id="_xqogeg5xt" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following replica set connection string includes these elements: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string-options/#mongodb-urioption-urioption.replicaSet"> <code class="leafygreen-ui-1l06pbn"> replicaSet </code> </a> option </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The hostname(s) of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance(s) as listed in the replica set configuration </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A username and password to <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/enable-authentication/"> enforce access control <!-- --> : </a> </p> </li> </ul> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-17"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_npc2tt015" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_4rd5nchb2" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_nfjyzm59j" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_vmzn4pd3z" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_ay8dppt82" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fqkybq0j7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_d27z2v539" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_66et8f9w7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_rx8x61fir" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_8wz4vjfn6" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_v1kkfvi47" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_q84r7903i" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_onbi5tjfk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_h6yw5x46q" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_l80djzba2" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_ay8fko7ag" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_gk9imwlqe" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lsazdjxwj" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_bnijyfqx2" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_vdk5hrchz" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_yg4pwexj1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_b9jztisli" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_zlmrgwdxk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_vcowi67lh" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_rq89i0rsp" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ldlsz07w9" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_er9pfnya8" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tm6wzz1y5" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_f1ii0agfw" class="leafygreen-ui-38lglc" id="_n5almwgbn" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-336-menu" aria-describedby="select-336-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-337" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14e:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14e:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14e:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14e:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ltpkcnvs0" class="leafygreen-ui-38lglc" id="_loydj0xvx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-339-menu" aria-describedby="select-339-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-340" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14f:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14f:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14f:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14f:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_nzzes3yac" class="leafygreen-ui-38lglc" id="_cj4zbmed4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-342-menu" aria-describedby="select-342-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-343" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14g:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14g:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14g:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14g:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_u31fhkz5n" class="leafygreen-ui-38lglc" id="_gt4ovl5fo" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-345-menu" aria-describedby="select-345-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-346" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14h:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14h:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14h:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14h:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_1gbudrdtj" class="leafygreen-ui-38lglc" id="_wst3dkcim" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-348-menu" aria-describedby="select-348-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-349" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14i:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14i:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14i:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14i:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_301eokclu" class="leafygreen-ui-38lglc" id="_5e7xubgf8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-351-menu" aria-describedby="select-351-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-352" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14j:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14j:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14j:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14j:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_fdx7ruy4x" class="leafygreen-ui-38lglc" id="_974xjk50k" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-354-menu" aria-describedby="select-354-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-355" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14k:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14k:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14k:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14k:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_mptfspkjo" class="" id="_cepstspo1" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-357-menu" aria-describedby="select-357-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-358" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14l:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14l:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14l:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14l:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_zyx49ek7g" class="leafygreen-ui-38lglc" id="_nldm3xcxt" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-360-menu" aria-describedby="select-360-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-361" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14m:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14m:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14m:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14m:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_p4qr9v5w3" class="leafygreen-ui-38lglc" id="_ogldnihsg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-363-menu" aria-describedby="select-363-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-364" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14n:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14n:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14n:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14n:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_0dm3k8i6z" class="leafygreen-ui-38lglc" id="_qo96rxe8i" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-366-menu" aria-describedby="select-366-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-367" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14o:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14o:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14o:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14o:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_8kahy5ia3" class="leafygreen-ui-38lglc" id="_1vg0lx26v" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-369-menu" aria-describedby="select-369-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-370" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14p:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14p:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14p:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14p:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_gwhwwvkml" class="leafygreen-ui-38lglc" id="_vec0q820o" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-372-menu" aria-describedby="select-372-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-373" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14q:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14q:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14q:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14q:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_q9iyp9knf" class="leafygreen-ui-38lglc" id="_vl6v3q50x" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&amp;replicaSet=myRepl</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-375-menu" aria-describedby="select-375-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-376" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14r:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14r:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14r:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14r:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If the username or password includes the following characters, those characters must be converted using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc3986#section-2.1" rel="noopener noreferrer"> <span> percent encoding <!-- --> : </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$ : / ? # [ ] @"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$ : / ? # [ ] @</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_3wetqo0ni" class="leafygreen-ui-38lglc" id="_4fg7p5eve" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following sharded cluster connection string includes the these elements: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> hosts in the connection string </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A username and password to <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/enable-authentication/"> enforce access control </a> </p> </li> </ul> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-18"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_vv878w69s" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_wqvwfge7v" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_nddo9jfdd" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2u21r9ebs" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_si59ghme5" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_xqfektywm" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_vn41l02y1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_v7te570dx" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_eziz3cg0f" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lnblowmt3" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_nv26qn92e" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lbwxujo1a" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_0u5hfh43w" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_hll37xvz4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_o9g5y1usl" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_v4k6lk7bx" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_9i0sq6a38" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_04vrnu9o0" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_rloujemi9" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_kcgtq86h7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_pjtmkjq9h" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_831u63z76" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_4peqhrely" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_c1oyc75hs" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_y068acjlk" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_liu06rva4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_gecugwli7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_wlhjycicc" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_755zzanih" class="leafygreen-ui-38lglc" id="_wovjshmkd" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb://mongos0.example.com:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb://mongos0.example.com:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-378-menu" aria-describedby="select-378-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-379" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14s:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14s:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14s:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14s:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_2pyb0eo6a" class="leafygreen-ui-38lglc" id="_ghus5fj6l" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-381-menu" aria-describedby="select-381-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-382" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14t:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14t:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14t:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14t:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_il95spsut" class="leafygreen-ui-38lglc" id="_733o8607k" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-384-menu" aria-describedby="select-384-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-385" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14u:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14u:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14u:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14u:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_5gf18xflh" class="leafygreen-ui-38lglc" id="_udoakvj5u" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-387-menu" aria-describedby="select-387-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-388" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r14v:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r14v:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14v:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r14v:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_9dfwtnnz5" class="leafygreen-ui-38lglc" id="_rwh5wmyrs" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-390-menu" aria-describedby="select-390-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-391" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r150:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r150:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r150:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r150:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_z50o1bg22" class="leafygreen-ui-38lglc" id="_drpa2xtfv" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-393-menu" aria-describedby="select-393-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-394" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r151:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r151:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r151:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r151:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_3qjoeajes" class="leafygreen-ui-38lglc" id="_rj25xt1ig" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-396-menu" aria-describedby="select-396-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-397" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r152:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r152:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r152:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r152:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_y2fr4r76a" class="" id="_jv2sop94x" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-399-menu" aria-describedby="select-399-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-400" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r153:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r153:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r153:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r153:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_4qvdq3qcg" class="leafygreen-ui-38lglc" id="_285ct1ell" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-402-menu" aria-describedby="select-402-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-403" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r154:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r154:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r154:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r154:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_lesv5u2yy" class="leafygreen-ui-38lglc" id="_cemieyyx4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-405-menu" aria-describedby="select-405-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-406" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r155:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r155:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r155:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r155:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_9at5lim0t" class="leafygreen-ui-38lglc" id="_2cxolwk9a" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-408-menu" aria-describedby="select-408-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-409" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r156:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r156:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r156:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r156:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_mij5o8x7t" class="leafygreen-ui-38lglc" id="_j1ym926d3" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-411-menu" aria-describedby="select-411-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-412" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r157:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r157:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r157:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r157:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ts1ivgey0" class="leafygreen-ui-38lglc" id="_0nasru20q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-414-menu" aria-describedby="select-414-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-415" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r158:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r158:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r158:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r158:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_qxrspb92f" class="leafygreen-ui-38lglc" id="_b8fj4m9r7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-417-menu" aria-describedby="select-417-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-418" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r159:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r159:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r159:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r159:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If the username or password includes the following characters, those characters must be converted using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc3986#section-2.1" rel="noopener noreferrer"> <span> percent encoding <!-- --> : </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$ : / ? # [ ] @"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$ : / ? # [ ] @</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_m1q7lb5s4" class="leafygreen-ui-38lglc" id="_kld9nd4zk" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> The following standalone connection string <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/enable-authentication/"> enforces access control <!-- --> : </a> </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-19"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_yz1h4df5h" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_b79wsjzqn" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_6kps6n64q" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_yv11jllor" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_6t5ciqema" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_p47pbnkhu" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_gkhc6et2z" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_4nw5aiv8v" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_g2zlkga0n" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_q6v58tthi" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_ximqclr9t" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2xbs9t0mj" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_bnd5yklnp" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_s034tygr8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_a1eav0gs0" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_eph4p2ghu" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_08njv6035" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_e2inr1sol" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_6vgn7qs71" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_nfgvnl6jy" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_avw7qo7vi" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_f7x38u4kq" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_u56wznj1t" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_5zfkog4p0" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_b8fiqg753" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lvsg3w3hp" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_2jjobplqr" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_g8q82drmy" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_ztzyqksue" class="leafygreen-ui-38lglc" id="_1au4n00y2" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb://@mongodb0.example.com:27017/?authSource=admin\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb://@mongodb0.example.com:27017/?authSource=admin"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-420-menu" aria-describedby="select-420-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-421" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15a:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15a:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15a:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15a:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_30v20b24k" class="leafygreen-ui-38lglc" id="_nlslgov15" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-423-menu" aria-describedby="select-423-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-424" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15b:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15b:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15b:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15b:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ajyfint4u" class="leafygreen-ui-38lglc" id="_hur9fwmbv" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-426-menu" aria-describedby="select-426-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-427" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15c:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15c:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15c:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15c:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_4f9ini28r" class="leafygreen-ui-38lglc" id="_eav7qr5wg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-429-menu" aria-describedby="select-429-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-430" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15d:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15d:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15d:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15d:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_mx6ids7rm" class="leafygreen-ui-38lglc" id="_jfimm934w" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-432-menu" aria-describedby="select-432-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-433" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15e:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15e:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15e:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15e:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_nvka2auwn" class="leafygreen-ui-38lglc" id="_l00se7f8z" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-435-menu" aria-describedby="select-435-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-436" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15f:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15f:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15f:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15f:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ar6t0r5hx" class="leafygreen-ui-38lglc" id="_3dewvq6nc" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-438-menu" aria-describedby="select-438-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-439" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15g:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15g:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15g:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15g:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_n4yt0st90" class="" id="_icuve743g" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-441-menu" aria-describedby="select-441-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-442" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15h:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15h:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15h:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15h:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_h2mnxo3m4" class="leafygreen-ui-38lglc" id="_w38pjdsem" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-444-menu" aria-describedby="select-444-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-445" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15i:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15i:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15i:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15i:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_8cyii01zm" class="leafygreen-ui-38lglc" id="_8srzb7a9q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-447-menu" aria-describedby="select-447-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-448" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15j:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15j:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15j:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15j:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_epy2vde26" class="leafygreen-ui-38lglc" id="_hy29p4bvg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-450-menu" aria-describedby="select-450-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-451" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15k:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15k:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15k:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15k:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_uqyuslcgz" class="leafygreen-ui-38lglc" id="_x1zzsf12a" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-453-menu" aria-describedby="select-453-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-454" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15l:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15l:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15l:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15l:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_axb6b9dxu" class="leafygreen-ui-38lglc" id="_mjedab8f0" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-456-menu" aria-describedby="select-456-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-457" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15m:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15m:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15m:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15m:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_255np9ed6" class="leafygreen-ui-38lglc" id="_5v4w3mftf" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017/?authSource=admin</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-459-menu" aria-describedby="select-459-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-460" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15n:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15n:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15n:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15n:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If the username or password includes the following characters, those characters must be converted using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://tools.ietf.org/html/rfc3986#section-2.1" rel="noopener noreferrer"> <span> percent encoding <!-- --> : </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"$ : / ? # [ ] @"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">$ : / ? # [ ] @</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Self-Hosted Database Server Running Locally <a class="headerlink leafygreen-ui-1kepx47" href="#self-hosted-database-server-running-locally" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="self-hosted-database-server-running-locally"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following connects to a database server running locally on the default port: </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-23"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_1d5p3je3l" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_c7drtys7g" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_pet0xvzod" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ihjo1m5mx" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_1vrl6z6dv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_m4kx8q1hj" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_snsmajyf6" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_jcjtaanet" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_k4idam1s9" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_abxfbxuae" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_omz2p6z4a" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_oftrcpctr" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_wr6vtb4a2" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ju0fko7ag" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_jzzr6x4qp" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_v61zjd4fj" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_fjd21ju9w" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_l28g35735" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_4w4csjs2v" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_fjqxmos1o" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_w8kdkbxb1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_yhj1sffp3" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_kvby3wk2m" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_99hiu5ozk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_g5nt17p4f" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ua1ema4uy" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_eaxu062ap" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_vkhnqei7b" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_0a4f2gwim" class="leafygreen-ui-38lglc" id="_j6hi1w8s5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb://localhost\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb://localhost"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-462-menu" aria-describedby="select-462-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-463" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15o:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15o:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15o:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15o:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_puhh8tzi6" class="leafygreen-ui-38lglc" id="_zl32wyo6i" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<span class="lg-highlight-comment">//localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-465-menu" aria-describedby="select-465-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-466" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15p:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15p:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15p:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15p:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ka17c9201" class="leafygreen-ui-38lglc" id="_7xdu0ixw3" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<span class="lg-highlight-comment">//localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-468-menu" aria-describedby="select-468-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-469" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15q:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15q:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15q:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15q:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_5mcdrseg7" class="leafygreen-ui-38lglc" id="_aes6xyamo" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<span class="lg-highlight-comment">//localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-471-menu" aria-describedby="select-471-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-472" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15r:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15r:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15r:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15r:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_y2omqejke" class="leafygreen-ui-38lglc" id="_q0i6h2n62" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<span class="lg-highlight-comment">//localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-474-menu" aria-describedby="select-474-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-475" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15s:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15s:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15s:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15s:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_1a3by3k8e" class="leafygreen-ui-38lglc" id="_wdytqryei" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<span class="lg-highlight-comment">//localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-477-menu" aria-describedby="select-477-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-478" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15t:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15t:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15t:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15t:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_c690qltla" class="leafygreen-ui-38lglc" id="_batjvftor" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<span class="lg-highlight-comment">//localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-480-menu" aria-describedby="select-480-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-481" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15u:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15u:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15u:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15u:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_24cd98h12" class="" id="_506yidnkj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<span class="lg-highlight-comment">//localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-483-menu" aria-describedby="select-483-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-484" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r15v:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r15v:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15v:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r15v:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_3233didtz" class="leafygreen-ui-38lglc" id="_ylg6takho" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<span class="lg-highlight-comment">//localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-486-menu" aria-describedby="select-486-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-487" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r160:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r160:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r160:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r160:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_m90zzl84b" class="leafygreen-ui-38lglc" id="_r7ufvtflb" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<span class="lg-highlight-comment">//localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-489-menu" aria-describedby="select-489-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-490" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r161:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r161:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r161:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r161:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_gn8sxioyf" class="leafygreen-ui-38lglc" id="_iynseil76" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<span class="lg-highlight-comment">//localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-492-menu" aria-describedby="select-492-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-493" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r162:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r162:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r162:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r162:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_9u1guhrgt" class="leafygreen-ui-38lglc" id="_73h6xhphv" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<span class="lg-highlight-comment">//localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-495-menu" aria-describedby="select-495-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-496" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r163:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r163:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r163:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r163:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_7jysquvwd" class="leafygreen-ui-38lglc" id="_kn74l0bpy" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<span class="lg-highlight-comment">//localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-498-menu" aria-describedby="select-498-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-499" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r164:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r164:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r164:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r164:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_1f018tm8c" class="leafygreen-ui-38lglc" id="_if0gkkjta" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<span class="lg-highlight-comment">//localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-501-menu" aria-describedby="select-501-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-502" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r165:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r165:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r165:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r165:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Self-Hosted <code class="leafygreen-ui-1l06pbn"> admin </code> Database Running Locally <a class="headerlink leafygreen-ui-1kepx47" href="#self-hosted-admin-database-running-locally" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="self-hosted-admin-database-running-locally"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following connects and logs in to the <code class="leafygreen-ui-1l06pbn"> admin </code> database as user <code class="leafygreen-ui-1l06pbn"> myDatabaseUser </code> with the password <code class="leafygreen-ui-1l06pbn"> D1fficultP%40ssw0rd </code> : </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-25"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_ul5exygo7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_m7p0nb9st" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_nfnsz9cja" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_zevsif279" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_h9n0h07f7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_qk60mlkui" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_w91iz1i6l" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2jpibi344" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_063rg3fk3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_dpuuuhnr6" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_20wor5uba" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_r318z4m8u" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_02zb63o4q" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_prnke9rkx" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_488b4sqrq" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_n4ihvhex7" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_x571bhrdx" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_l5r2dmcy7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_hizi1cgvr" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9kgazlhrl" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_vj4sqzkni" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_dkpcoxq3s" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_b3swd85im" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_aoa2ssq3l" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_pxgcvhako" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_x18ahdupl" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_l8dzsy10j" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_wk3vyie4m" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_fvyvy008l" class="leafygreen-ui-38lglc" id="_42r0itrbs" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb://localhost\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb://localhost"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-504-menu" aria-describedby="select-504-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-505" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r166:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r166:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r166:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r166:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_viqagj55p" class="leafygreen-ui-38lglc" id="_b8bt5pyzx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-507-menu" aria-describedby="select-507-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-508" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r167:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r167:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r167:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r167:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_snmw8qnht" class="leafygreen-ui-38lglc" id="_kn84jn6ak" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-510-menu" aria-describedby="select-510-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-511" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r168:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r168:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r168:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r168:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_l6kb7jnj9" class="leafygreen-ui-38lglc" id="_exozi7h4k" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-513-menu" aria-describedby="select-513-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-514" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r169:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r169:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r169:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r169:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_yzdg6w9sp" class="leafygreen-ui-38lglc" id="_1nhor07xv" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-516-menu" aria-describedby="select-516-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-517" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16a:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16a:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16a:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16a:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_sbn8rx2m2" class="leafygreen-ui-38lglc" id="_uo7blbkgx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-519-menu" aria-describedby="select-519-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-520" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16b:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16b:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16b:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16b:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_b2glqoukx" class="leafygreen-ui-38lglc" id="_0fsiujz0i" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-522-menu" aria-describedby="select-522-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-523" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16c:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16c:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16c:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16c:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_obehu1qhi" class="" id="_oxfdoci5j" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-525-menu" aria-describedby="select-525-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-526" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16d:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16d:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16d:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16d:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_nkkx4pmn7" class="leafygreen-ui-38lglc" id="_irosx08bs" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-528-menu" aria-describedby="select-528-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-529" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16e:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16e:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16e:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16e:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_bxxejljgi" class="leafygreen-ui-38lglc" id="_invowlgsi" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-531-menu" aria-describedby="select-531-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-532" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16f:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16f:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16f:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16f:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_sjgg3vqt1" class="leafygreen-ui-38lglc" id="_vlx1lik7c" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-534-menu" aria-describedby="select-534-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-535" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16g:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16g:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16g:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16g:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_6y7pokcdo" class="leafygreen-ui-38lglc" id="_t1pna4bh7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-537-menu" aria-describedby="select-537-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-538" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16h:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16h:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16h:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16h:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_jj38m5cnm" class="leafygreen-ui-38lglc" id="_3yl022kgz" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-540-menu" aria-describedby="select-540-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-541" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16i:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16i:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16i:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16i:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_m8wvqwiiw" class="leafygreen-ui-38lglc" id="_gfpvgmow8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-543-menu" aria-describedby="select-543-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-544" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16j:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16j:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16j:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16j:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Self-Hosted <code class="leafygreen-ui-1l06pbn"> records </code> Database Running Locally <a class="headerlink leafygreen-ui-1kepx47" href="#self-hosted-records-database-running-locally" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="self-hosted-records-database-running-locally"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following connects and logs in to the <code class="leafygreen-ui-1l06pbn"> records </code> database as user <code class="leafygreen-ui-1l06pbn"> myDatabaseUser </code> with the password <code class="leafygreen-ui-1l06pbn"> D1fficultP%40ssw0rd </code> : </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-27"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_8btdwd6hb" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lm25p8h6u" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_jch30wywx" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ljk0cce01" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_fx3rvjvo4" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_iku3cynot" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_okhpjy9wh" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_36xjeonoy" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_2wlc1lzbq" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2ij78k525" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_1h7rxb708" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_o408xajfy" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_mtwtcwtij" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_380gihzgv" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_obmn4uy0f" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_2uokmk90h" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_bcv2iql8k" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_mkmw6gwq5" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_3ai0zzrpu" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_rfbx3q4b5" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_x7635a80e" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_gnia4ulnv" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_n853a9tof" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_pbviprbbv" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_z7i432sp0" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_pfautc9sj" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_sl3tzmy41" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_w318xbvyz" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_jq61edv1k" class="leafygreen-ui-38lglc" id="_e6lce00pd" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb://localhost/records\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb://localhost/records"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-546-menu" aria-describedby="select-546-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-547" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16k:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16k:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16k:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16k:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_evnh9nnhy" class="leafygreen-ui-38lglc" id="_9nn0phc8u" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost/records","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost/records</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-549-menu" aria-describedby="select-549-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-550" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16l:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16l:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16l:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16l:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_fnhb5x0bx" class="leafygreen-ui-38lglc" id="_1aqi5bpt9" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost/records","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost/records</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-552-menu" aria-describedby="select-552-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-553" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16m:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16m:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16m:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16m:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_rhvmac5wp" class="leafygreen-ui-38lglc" id="_irk3n15n8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost/records","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost/records</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-555-menu" aria-describedby="select-555-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-556" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16n:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16n:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16n:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16n:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_zh0v4i868" class="leafygreen-ui-38lglc" id="_2lcqkxq66" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost/records","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost/records</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-558-menu" aria-describedby="select-558-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-559" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16o:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16o:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16o:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16o:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_6ez2u3p0b" class="leafygreen-ui-38lglc" id="_dc10ff73g" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost/records","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost/records</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-561-menu" aria-describedby="select-561-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-562" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16p:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16p:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16p:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16p:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ul1v8u8h7" class="leafygreen-ui-38lglc" id="_0lll12f2k" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost/records","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost/records</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-564-menu" aria-describedby="select-564-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-565" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16q:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16q:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16q:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16q:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_xop4nmx2e" class="" id="_yy8sqkq2p" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost/records","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost/records</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-567-menu" aria-describedby="select-567-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-568" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16r:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16r:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16r:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16r:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_yedlx9run" class="leafygreen-ui-38lglc" id="_ed2lxuzbb" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost/records","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost/records</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-570-menu" aria-describedby="select-570-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-571" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16s:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16s:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16s:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16s:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_6dl0ty24a" class="leafygreen-ui-38lglc" id="_3h86ybpao" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost/records","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost/records</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-573-menu" aria-describedby="select-573-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-574" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16t:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16t:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16t:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16t:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_9mz9igjww" class="leafygreen-ui-38lglc" id="_h1hzrxuvt" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost/records","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost/records</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-576-menu" aria-describedby="select-576-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-577" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16u:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16u:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16u:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16u:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_89rsbr1ug" class="leafygreen-ui-38lglc" id="_va3bshdyd" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost/records","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost/records</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-579-menu" aria-describedby="select-579-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-580" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r16v:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r16v:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16v:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r16v:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_fno3jm6bc" class="leafygreen-ui-38lglc" id="_7zt0thk91" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost/records","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost/records</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-582-menu" aria-describedby="select-582-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-583" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r170:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r170:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r170:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r170:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_f0c9a3gq4" class="leafygreen-ui-38lglc" id="_i3q5iytga" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost/records","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost/records</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-585-menu" aria-describedby="select-585-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-586" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r171:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r171:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r171:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r171:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Self-Hosted UNIX Domain Socket <a class="headerlink leafygreen-ui-1kepx47" href="#self-hosted-unix-domain-socket" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="self-hosted-unix-domain-socket"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use a URL encoded connection string when connecting to a UNIX domain socket. </p> <p class="leafygreen-ui-1kp3ins"> The following connects to a UNIX domain socket with file path <code class="leafygreen-ui-1l06pbn"> /tmp/mongodb-27017.sock </code> as user <code class="leafygreen-ui-1l06pbn"> myDatabaseUser </code> with the password <code class="leafygreen-ui-1l06pbn"> D1fficultP%40ssw0rd </code> : </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-29"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_zuh4ob0rz" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_hd3jvkgwj" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_jt2j5bzce" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_em158k0bo" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_5gzjl6ghn" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9llwnl549" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_7wd7evxls" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2wrdkog25" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_wdksr3dme" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_hwiu5l4av" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_lergp88xi" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_4tecx3qyk" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_k5zp6vt8k" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_mdtdu3qcm" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_xzmme513x" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_4dhvqsnbi" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_r9vne1e5m" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_yafi3cbx6" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_vv1o8gpn9" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_79mk79ewx" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_unsg8ihb7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_v42uoa2tj" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_rfx39l00s" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_94nh4wczn" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_faqz4ywx8" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_n149lex82" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_sce17nqna" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ttk4ht8jd" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_vrumd1a8l" class="leafygreen-ui-38lglc" id="_dr6cfhvmj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-588-menu" aria-describedby="select-588-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-589" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r172:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r172:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r172:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r172:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_bt5ecjpkz" class="leafygreen-ui-38lglc" id="_qo3vmfvde" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-591-menu" aria-describedby="select-591-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-592" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r173:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r173:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r173:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r173:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_rq185blhg" class="leafygreen-ui-38lglc" id="_c14fez4aw" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-594-menu" aria-describedby="select-594-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-595" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r174:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r174:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r174:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r174:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_hudxkri2p" class="leafygreen-ui-38lglc" id="_3b90wts1n" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-597-menu" aria-describedby="select-597-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-598" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r175:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r175:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r175:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r175:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_f5fwnfcv9" class="leafygreen-ui-38lglc" id="_eedg5e5a4" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-600-menu" aria-describedby="select-600-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-601" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r176:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r176:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r176:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r176:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_rwifhlaha" class="leafygreen-ui-38lglc" id="_0hvdm28qe" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-603-menu" aria-describedby="select-603-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-604" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r177:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r177:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r177:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r177:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_r9z7o43ng" class="leafygreen-ui-38lglc" id="_d6u4xd4pn" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-606-menu" aria-describedby="select-606-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-607" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r178:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r178:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r178:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r178:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_cr95z7u8g" class="" id="_qjs2o130e" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-609-menu" aria-describedby="select-609-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-610" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r179:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r179:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r179:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r179:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_nm21lkzpq" class="leafygreen-ui-38lglc" id="_gwreka1wr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-612-menu" aria-describedby="select-612-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-613" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17a:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17a:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17a:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17a:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_sfvy36sh7" class="leafygreen-ui-38lglc" id="_pabfxhyoj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-615-menu" aria-describedby="select-615-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-616" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17b:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17b:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17b:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17b:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_f5lwqi99q" class="leafygreen-ui-38lglc" id="_rhugaizwi" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-618-menu" aria-describedby="select-618-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-619" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17c:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17c:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17c:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17c:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_jbvufc0pd" class="leafygreen-ui-38lglc" id="_fy3fz0tgm" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-621-menu" aria-describedby="select-621-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-622" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17d:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17d:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17d:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17d:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_egtmls9ni" class="leafygreen-ui-38lglc" id="_ngtsiv722" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-624-menu" aria-describedby="select-624-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-625" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17e:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17e:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17e:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17e:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_cdppgfhdq" class="leafygreen-ui-38lglc" id="_fpo6eh84t" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@%2Ftmp%2Fmongodb-27017.sock</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-627-menu" aria-describedby="select-627-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-628" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17f:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17f:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17f:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17f:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Not all drivers support UNIX domain sockets. For information on your driver, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> Drivers </span> </a> documentation. </p> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Self-Hosted Replica Set with Members on Different Machines <a class="headerlink leafygreen-ui-1kepx47" href="#self-hosted-replica-set-with-members-on-different-machines" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="self-hosted-replica-set-with-members-on-different-machines"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following connects to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> with two members, one on <code class="leafygreen-ui-1l06pbn"> db1.example.net </code> and the other on <code class="leafygreen-ui-1l06pbn"> db2.example.net </code> , as user <code class="leafygreen-ui-1l06pbn"> myDatabaseUser </code> with the password <code class="leafygreen-ui-1l06pbn"> D1fficultP%40ssw0rd </code> : </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For a replica set, specify the hostname(s) of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance(s) as listed in the replica set configuration. </p> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-31"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_khz219d8j" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_bf3emlke4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_0nmqts0rx" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_i9wd0otk8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_3gikpwf6j" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_dfx59td9i" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_qfilsg4my" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0wtoy480r" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_ww62e2obh" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_cyhgfrt6e" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_qswcsywez" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lo6gk6lsc" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_0xl1yerqj" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_lqlk0oyzt" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_eqi90qc3t" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_eklgwbqnz" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_d2aavbp2l" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_36kwgwx8j" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_6w9lpaj97" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_89168n22m" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_7pxm4unvx" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_o4pzjhlc9" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_s509axrab" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_pve19p267" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_duc2cpfeq" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_4axl2ljpu" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_6vuyfa8dt" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_3kt2majgv" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_oald84g06" class="leafygreen-ui-38lglc" id="_lul6i12ie" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb://db1.example.net,db2.example.com/?replicaSet=test\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb://db1.example.net,db2.example.com/?replicaSet=test"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-630-menu" aria-describedby="select-630-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-631" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17g:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17g:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17g:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17g:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ld1eikbbv" class="leafygreen-ui-38lglc" id="_72jumf51s" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-633-menu" aria-describedby="select-633-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-634" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17h:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17h:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17h:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17h:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_pq245no14" class="leafygreen-ui-38lglc" id="_50ep7s8s8" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-636-menu" aria-describedby="select-636-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-637" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17i:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17i:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17i:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17i:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ro7bcvzrr" class="leafygreen-ui-38lglc" id="_9jkzaegl3" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-639-menu" aria-describedby="select-639-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-640" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17j:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17j:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17j:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17j:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_00r0dw1qf" class="leafygreen-ui-38lglc" id="_ibx477nei" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-642-menu" aria-describedby="select-642-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-643" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17k:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17k:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17k:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17k:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ykvtiqh1m" class="leafygreen-ui-38lglc" id="_de6yrcuxa" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-645-menu" aria-describedby="select-645-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-646" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17l:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17l:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17l:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17l:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_6mqe4tov8" class="leafygreen-ui-38lglc" id="_8twe26zql" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-648-menu" aria-describedby="select-648-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-649" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17m:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17m:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17m:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17m:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_4l0m7eqc6" class="" id="_cezfex6f7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-651-menu" aria-describedby="select-651-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-652" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17n:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17n:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17n:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17n:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_nszzmq47h" class="leafygreen-ui-38lglc" id="_flogfgatc" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-654-menu" aria-describedby="select-654-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-655" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17o:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17o:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17o:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17o:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_t5jhzzx4d" class="leafygreen-ui-38lglc" id="_cg0255p2p" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-657-menu" aria-describedby="select-657-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-658" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17p:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17p:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17p:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17p:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_3g1tmkwsx" class="leafygreen-ui-38lglc" id="_ueoi41idv" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-660-menu" aria-describedby="select-660-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-661" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17q:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17q:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17q:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17q:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_3cy0c6ndv" class="leafygreen-ui-38lglc" id="_dqwczf862" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-663-menu" aria-describedby="select-663-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-664" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17r:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17r:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17r:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17r:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_z2s6myocl" class="leafygreen-ui-38lglc" id="_29t140eyf" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-666-menu" aria-describedby="select-666-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-667" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17s:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17s:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17s:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17s:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_zq5wu34pn" class="leafygreen-ui-38lglc" id="_k8goewgzl" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],db2.example.com/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-669-menu" aria-describedby="select-669-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-670" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17t:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17t:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17t:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17t:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Self-Hosted Replica Set with Members on <code class="leafygreen-ui-1l06pbn"> localhost </code> <a class="headerlink leafygreen-ui-1kepx47" href="#self-hosted-replica-set-with-members-on-localhost" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="self-hosted-replica-set-with-members-on-localhost"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following connects to a replica set with three members running on <code class="leafygreen-ui-1l06pbn"> localhost </code> on ports <code class="leafygreen-ui-1l06pbn"> 27017 </code> , <code class="leafygreen-ui-1l06pbn"> 27018 </code> , and <code class="leafygreen-ui-1l06pbn"> 27019 </code> as user <code class="leafygreen-ui-1l06pbn"> myDatabaseUser </code> with the password <code class="leafygreen-ui-1l06pbn"> D1fficultP%40ssw0rd </code> : </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For a replica set, specify the hostname(s) of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance(s) as listed in the replica set configuration. </p> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-33"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_vszx7iyfi" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_rdi57mzj0" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_ulax6l1lc" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9sksdnra4" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_xq33127tg" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0z4g1j5u5" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_lsxq3le6u" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_6t8dr4va9" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_n4d393dad" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_wj2pcvjy3" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_7pk84lcu3" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_bmkwr7jjo" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_70yzi4qxj" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_pl5zhtfiw" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_kri7ke9j8" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_4tnlshpsf" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_fxr0mreip" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_p142eudds" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_haqwlvpl1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_7xfx68l35" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_zlol557ng" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_v697p63u7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_ssw7u7m5z" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_mj2ct8f6c" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_6xhxhyns0" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ozaao672j" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_nis68jc8x" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_3ywianp7n" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_ore0cg6og" class="leafygreen-ui-38lglc" id="_nb52swghr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb://localhost,localhost:27018,localhost:27019/?replicaSet=test\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb://localhost,localhost:27018,localhost:27019/?replicaSet=test"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-672-menu" aria-describedby="select-672-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-673" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17u:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17u:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17u:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17u:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_yuotwpqex" class="leafygreen-ui-38lglc" id="_s0k34xdju" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-675-menu" aria-describedby="select-675-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-676" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r17v:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r17v:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17v:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r17v:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_oqesx58kx" class="leafygreen-ui-38lglc" id="_k61h263s5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-678-menu" aria-describedby="select-678-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-679" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r180:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r180:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r180:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r180:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_3w4h9yl1y" class="leafygreen-ui-38lglc" id="_oe4557mhu" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-681-menu" aria-describedby="select-681-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-682" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r181:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r181:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r181:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r181:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ckrdlj61o" class="leafygreen-ui-38lglc" id="_oi6504di5" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-684-menu" aria-describedby="select-684-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-685" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r182:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r182:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r182:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r182:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_th34xph5o" class="leafygreen-ui-38lglc" id="_ktg70dccr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-687-menu" aria-describedby="select-687-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-688" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r183:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r183:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r183:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r183:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_cdqlb8iwi" class="leafygreen-ui-38lglc" id="_vzsg6adac" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-690-menu" aria-describedby="select-690-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-691" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r184:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r184:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r184:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r184:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_tphxzjfl1" class="" id="_9bszp4xvk" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-693-menu" aria-describedby="select-693-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-694" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r185:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r185:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r185:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r185:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_feb78cvqv" class="leafygreen-ui-38lglc" id="_31i80c0wp" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-696-menu" aria-describedby="select-696-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-697" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r186:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r186:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r186:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r186:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_cge9ew19w" class="leafygreen-ui-38lglc" id="_vwfnuatkj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-699-menu" aria-describedby="select-699-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-700" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r187:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r187:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r187:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r187:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_55zjocvdr" class="leafygreen-ui-38lglc" id="_4zeasn8er" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-702-menu" aria-describedby="select-702-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-703" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r188:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r188:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r188:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r188:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_xjffg3mrm" class="leafygreen-ui-38lglc" id="_yzddpcp6n" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-705-menu" aria-describedby="select-705-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-706" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r189:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r189:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r189:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r189:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_knuusb7a8" class="leafygreen-ui-38lglc" id="_8h8eckr5d" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-708-menu" aria-describedby="select-708-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-709" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18a:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18a:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18a:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18a:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_uoxu92lps" class="leafygreen-ui-38lglc" id="_4ixb4pwu0" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%40ssw0rd@localhost,localhost:27018,localhost:27019/?replicaSet=test</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-711-menu" aria-describedby="select-711-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-712" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18b:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18b:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18b:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18b:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Self-Hosted Replica Set with Read Distribution <a class="headerlink leafygreen-ui-1kepx47" href="#self-hosted-replica-set-with-read-distribution" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="self-hosted-replica-set-with-read-distribution"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following connects to a replica set with three members and distributes reads to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondaries </a> as user <code class="leafygreen-ui-1l06pbn"> myDatabaseUser </code> with the password <code class="leafygreen-ui-1l06pbn"> D1fficultP%40ssw0rd </code> : </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For a replica set, specify the hostname(s) of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance(s) as listed in the replica set configuration. </p> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-35"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_imbrhmgsf" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_y3q8lc82v" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_42te9tv0s" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_x5rpm155u" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_udncguscv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_g4lmd4l7m" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_6br6wde0h" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_t8jy7runz" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_lgv6ls7or" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ev1n22r32" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_88pi0o2sz" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_2ulgpg875" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_w1szlnbtq" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_0095o4muv" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_modombda2" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_qk8ea9fku" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_tylj4w6hd" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_bh66xia54" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_w4hg6g9sw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9onp6cgm8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_717uc6mns" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_8uwjs9x3a" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_ts4ek0qj4" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_vnqopo8gh" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_eq72b64fa" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_7sed2xwq0" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_6q8gebg6f" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_s2enydsgb" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_heq83bxi8" class="leafygreen-ui-38lglc" id="_w4wray4pc" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb://example1.com,example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb://example1.com,example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-714-menu" aria-describedby="select-714-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-715" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18c:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18c:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18c:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18c:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_d30jspo0s" class="leafygreen-ui-38lglc" id="_nlv7z8r5c" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-717-menu" aria-describedby="select-717-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-718" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18d:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18d:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18d:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18d:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_9iz5m8qe2" class="leafygreen-ui-38lglc" id="_2bvzvz5ie" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-720-menu" aria-describedby="select-720-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-721" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18e:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18e:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18e:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18e:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_5963czp9m" class="leafygreen-ui-38lglc" id="_rb4gjv02a" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-723-menu" aria-describedby="select-723-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-724" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18f:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18f:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18f:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18f:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_mjzuvf42a" class="leafygreen-ui-38lglc" id="_o3hmbuq4n" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-726-menu" aria-describedby="select-726-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-727" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18g:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18g:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18g:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18g:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_a98x3mir4" class="leafygreen-ui-38lglc" id="_py466rac7" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-729-menu" aria-describedby="select-729-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-730" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18h:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18h:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18h:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18h:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_0kmfxi21m" class="leafygreen-ui-38lglc" id="_erfl3uh2h" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-732-menu" aria-describedby="select-732-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-733" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18i:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18i:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18i:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18i:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_psxl8sqtd" class="" id="_rymh890zp" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-735-menu" aria-describedby="select-735-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-736" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18j:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18j:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18j:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18j:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_wwyjyjc2h" class="leafygreen-ui-38lglc" id="_9vb4cgwgg" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-738-menu" aria-describedby="select-738-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-739" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18k:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18k:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18k:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18k:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_7emt88b3t" class="leafygreen-ui-38lglc" id="_fo4uecpfc" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-741-menu" aria-describedby="select-741-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-742" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18l:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18l:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18l:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18l:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_uby9qsjuv" class="leafygreen-ui-38lglc" id="_9bpnejro3" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-744-menu" aria-describedby="select-744-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-745" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18m:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18m:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18m:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18m:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_vrly8yyp1" class="leafygreen-ui-38lglc" id="_bjpjr55ly" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-747-menu" aria-describedby="select-747-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-748" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18n:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18n:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18n:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18n:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_1pacfimrm" class="leafygreen-ui-38lglc" id="_v9i24ztqy" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-750-menu" aria-describedby="select-750-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-751" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18o:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18o:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18o:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18o:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_srg4yxi4c" class="leafygreen-ui-38lglc" id="_38qmd225k" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;readPreference=secondary</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-753-menu" aria-describedby="select-753-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-754" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18p:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18p:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18p:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18p:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Self-Hosted Replica Set with a High Level of Write Concern <a class="headerlink leafygreen-ui-1kepx47" href="#self-hosted-replica-set-with-a-high-level-of-write-concern" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="self-hosted-replica-set-with-a-high-level-of-write-concern"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following connects to a replica set with write concern configured to wait for replication to succeed across a majority of the data-bearing voting members, with a two-second timeout. It authenticates as user <code class="leafygreen-ui-1l06pbn"> myDatabaseUser </code> with the password <code class="leafygreen-ui-1l06pbn"> D1fficultP%40ssw0rd </code> . </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For a replica set, specify the hostname(s) of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance(s) as listed in the replica set configuration. </p> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-37"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_h7rsmowra" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9b3r51wn2" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_7ursmy4y1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_213lx9k7h" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_h5rcu9k3u" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_1932ct7y1" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_wykudxwlh" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_7c7n8v833" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_52nujkupn" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ikpfm0mxa" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_271zpirii" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_rzsxfezf5" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_rea7v0dwy" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_ziv9wpczy" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_it1niiges" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_5o4adrdt3" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_hpdn4cckf" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_bnx5pr7l7" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_lw0bbzemp" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_v02kiukec" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_v82oqhllg" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_227grrgg3" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_rcm7jr1qd" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_wx4bkg2pl" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_f7572b8xf" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_6gcszxp76" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_xtn1xm13r" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_8ed9dl863" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_f6mt2bqbb" class="leafygreen-ui-38lglc" id="_hdaiaje77" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb://example1.com,example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb://example1.com,example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-756-menu" aria-describedby="select-756-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-757" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18q:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18q:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18q:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18q:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_hprqailt2" class="leafygreen-ui-38lglc" id="_w0a2nbsbf" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-759-menu" aria-describedby="select-759-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-760" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18r:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18r:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18r:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18r:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_33hoyxhxz" class="leafygreen-ui-38lglc" id="_8835q5urt" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-762-menu" aria-describedby="select-762-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-763" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18s:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18s:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18s:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18s:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_r4xlqthae" class="leafygreen-ui-38lglc" id="_v9imt1xot" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-765-menu" aria-describedby="select-765-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-766" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18t:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18t:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18t:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18t:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_p58y3t21r" class="leafygreen-ui-38lglc" id="_5knb1m1xj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-768-menu" aria-describedby="select-768-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-769" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18u:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18u:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18u:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18u:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_nxozxjvr7" class="leafygreen-ui-38lglc" id="_g7eihh2br" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-771-menu" aria-describedby="select-771-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-772" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r18v:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r18v:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18v:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r18v:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_e6bsuvjci" class="leafygreen-ui-38lglc" id="_v1hgysf47" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-774-menu" aria-describedby="select-774-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-775" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r190:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r190:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r190:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r190:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_dfouqjxki" class="" id="_zeviscxbx" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-777-menu" aria-describedby="select-777-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-778" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r191:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r191:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r191:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r191:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_t36ooy3zn" class="leafygreen-ui-38lglc" id="_r9co90ikz" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-780-menu" aria-describedby="select-780-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-781" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r192:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r192:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r192:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r192:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_5f1luga6k" class="leafygreen-ui-38lglc" id="_ulf1cnczd" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-783-menu" aria-describedby="select-783-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-784" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r193:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r193:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r193:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r193:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_9e5mfbsyl" class="leafygreen-ui-38lglc" id="_71p5gz7t0" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-786-menu" aria-describedby="select-786-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-787" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r194:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r194:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r194:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r194:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_0u8bv6ur1" class="leafygreen-ui-38lglc" id="_8p0p47cda" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-789-menu" aria-describedby="select-789-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-790" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r195:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r195:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r195:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r195:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ri64gok8z" class="leafygreen-ui-38lglc" id="_35kd0snjp" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-792-menu" aria-describedby="select-792-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-793" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r196:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r196:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r196:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r196:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_sqwud9n19" class="leafygreen-ui-38lglc" id="_f4j205d4q" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected],example2.com,example3.com/?replicaSet=test&amp;w=majority&amp;wtimeoutMS=2000</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-795-menu" aria-describedby="select-795-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-796" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r197:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r197:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r197:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r197:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Self-Hosted Sharded Cluster <a class="headerlink leafygreen-ui-1kepx47" href="#self-hosted-sharded-cluster" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="self-hosted-sharded-cluster"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following connects to a sharded cluster with three <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances as user <code class="leafygreen-ui-1l06pbn"> myDatabaseUser </code> with the password <code class="leafygreen-ui-1l06pbn"> D1fficultP%40ssw0rd </code> : </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-f2qztv" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-39"> <div aria-label="Tabs to describe usage of drivers" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_nwvo3or66" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9xm9zkaso" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> MongoDB Shell </div> </button> <button aria-controls="_9iy01kxsm" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_pf5dmboby" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Compass </div> </button> <button aria-controls="_j1c5v48py" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_igt2nmxku" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> C# </div> </button> <button aria-controls="_4h2p7vw8s" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_h1xt2nmtn" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Go </div> </button> <button aria-controls="_7yqs2ehkv" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_z8921fjyq" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Async) </div> </button> <button aria-controls="_5ubc197rw" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_os6ss0u60" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Java (Sync) </div> </button> <button aria-controls="_i6kl4ab3i" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tv5m3ynt8" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Motor </div> </button> <button aria-controls="_5bjghnkau" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_ht9m6giwp" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Node.js </div> </button> <button aria-controls="_wfa43kom5" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_z5wd9hvtd" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Perl </div> </button> <button aria-controls="_4qxv1n9aa" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_v1hpc6f7w" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PHP </div> </button> <button aria-controls="_triww8jfn" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_dwbs723ug" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Python </div> </button> <button aria-controls="_exhos9sfc" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_gekclreqz" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Ruby </div> </button> <button aria-controls="_f4x4hm8x9" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_tykrxtmdh" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Rust </div> </button> <button aria-controls="_sxzuvhthn" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_72pamdmja" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Scala </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_g6yvxgx2k" class="leafygreen-ui-38lglc" id="_qx1vykljh" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh \"mongodb://router1.example.com:27017,router2.example2.com:27017,router3.example3.com:27017/\" --apiVersion 1 --username myDatabaseUser","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh <span class="lg-highlight-string">"mongodb://router1.example.com:27017,router2.example2.com:27017,router3.example3.com:27017/"</span> --apiVersion <span class="lg-highlight-number">1</span> --username myDatabaseUser</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-798-menu" aria-describedby="select-798-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-799" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r198:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r198:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r198:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r198:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_nl7qjsj2r" class="leafygreen-ui-38lglc" id="_cfxfx0n28" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-801-menu" aria-describedby="select-801-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-802" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r199:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r199:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r199:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r199:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_pvvk8h65l" class="leafygreen-ui-38lglc" id="_lqvdue022" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-804-menu" aria-describedby="select-804-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-805" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r19a:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r19a:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19a:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19a:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_navnrc1fk" class="leafygreen-ui-38lglc" id="_cgllngwit" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-807-menu" aria-describedby="select-807-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-808" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r19b:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r19b:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19b:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19b:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ftf24qod9" class="leafygreen-ui-38lglc" id="_jmo37ru3f" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-810-menu" aria-describedby="select-810-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-811" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r19c:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r19c:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19c:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19c:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_c00z4rnbb" class="leafygreen-ui-38lglc" id="_s16dwa0qs" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-813-menu" aria-describedby="select-813-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-814" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r19d:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r19d:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19d:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19d:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_yga3x16z9" class="leafygreen-ui-38lglc" id="_lmlgrl1bp" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-816-menu" aria-describedby="select-816-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-817" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r19e:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r19e:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19e:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19e:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_rksh2iy4n" class="" id="_0esgw4jdr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-819-menu" aria-describedby="select-819-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-820" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r19f:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r19f:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19f:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19f:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_s6w13583v" class="leafygreen-ui-38lglc" id="_baok0mztr" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-822-menu" aria-describedby="select-822-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-823" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r19g:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r19g:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19g:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19g:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_bskeocfub" class="leafygreen-ui-38lglc" id="_9r59arabc" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-825-menu" aria-describedby="select-825-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-826" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r19h:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r19h:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19h:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19h:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_7634zhfxp" class="leafygreen-ui-38lglc" id="_pp7t56eem" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-828-menu" aria-describedby="select-828-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-829" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r19i:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r19i:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19i:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19i:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_gnepe266k" class="leafygreen-ui-38lglc" id="_iwl7q8kxy" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-831-menu" aria-describedby="select-831-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-832" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r19j:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r19j:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19j:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19j:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_5llecqlew" class="leafygreen-ui-38lglc" id="_6wix2taw6" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-834-menu" aria-describedby="select-834-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-835" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r19k:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r19k:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19k:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19k:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_63c2i5yvh" class="leafygreen-ui-38lglc" id="_fxpvkqctj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-9lvdmr"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><!-- --><span class="lg-highlight-attr">mongodb</span>:<!-- --><span class="lg-highlight-comment">//myDatabaseUser:D1fficultP%[email protected]:27017,router2.example2.com:27017,router3.example3.com:27017/</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-hcrzu6" data-testid="leafygreen-code-panel"> <div class="leafygreen-ui-148abs6"> <div class="leafygreen-ui-omjz13" data-lgid="lg-select"> <button aria-controls="select-837-menu" aria-describedby="select-837-description" aria-disabled="false" aria-expanded="false" aria-invalid="false" aria-labelledby="Language Picker" class="lg-ui-button-0000 leafygreen-ui-dvfj9v" data-lgid="lg-button" data-testid="leafygreen-ui-select-menubutton" id="select-838" type="button" value="Node.js"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg aria-hidden="true" class="leafygreen-ui-18si895" fill="none" role="presentation" viewbox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_2131_12968)"> <mask height="19" id="mask0_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask0_2131_12968)"> <mask height="19" id="mask1_2131_12968" maskunits="userSpaceOnUse" width="30" x="0" y="6"> <path d="M30 6.04395H0V24.3825H30V6.04395Z" fill="white"> </path> </mask> <g mask="url(#mask1_2131_12968)"> <path d="M14.8241 24.3823C14.7224 24.3823 14.6274 24.3552 14.5393 24.3078L13.6374 23.7731C13.5018 23.6986 13.5696 23.6715 13.6103 23.658C13.7934 23.597 13.8273 23.5835 14.0172 23.4751C14.0375 23.4616 14.0646 23.4684 14.085 23.4819L14.7767 23.8949C14.8038 23.9084 14.8377 23.9084 14.858 23.8949L17.5637 22.3311C17.5909 22.3176 17.6044 22.2905 17.6044 22.2567V19.136C17.6044 19.1021 17.5909 19.075 17.5637 19.0615L14.858 17.5045C14.8309 17.4909 14.797 17.4909 14.7767 17.5045L12.071 19.0615C12.0439 19.075 12.0302 19.1089 12.0302 19.136V22.2567C12.0302 22.2838 12.0439 22.3176 12.071 22.3311L12.8101 22.7576C13.2102 22.9607 13.4611 22.7237 13.4611 22.4868V19.4067C13.4611 19.3661 13.495 19.3255 13.5425 19.3255H13.8884C13.929 19.3255 13.9697 19.3593 13.9697 19.4067V22.4868C13.9697 23.0217 13.6781 23.333 13.1695 23.333C13.0136 23.333 12.8915 23.333 12.5457 23.1638L11.8336 22.7576C11.6574 22.6561 11.5488 22.4665 11.5488 22.2635V19.1427C11.5488 18.9396 11.6574 18.7501 11.8336 18.6485L14.5393 17.0848C14.7089 16.99 14.9394 16.99 15.109 17.0848L17.8146 18.6485C17.9909 18.7501 18.0995 18.9396 18.0995 19.1427V22.2635C18.0995 22.4665 17.9909 22.6561 17.8146 22.7576L15.109 24.3214C15.0276 24.3552 14.9259 24.3823 14.8241 24.3823Z" fill="black"> </path> <path d="M15.6643 22.2362C14.4775 22.2362 14.2334 21.6946 14.2334 21.2343C14.2334 21.1936 14.2673 21.153 14.3147 21.153H14.6674C14.7081 21.153 14.742 21.1801 14.742 21.2207C14.7963 21.5795 14.9522 21.7555 15.671 21.7555C16.2407 21.7555 16.4847 21.6269 16.4847 21.3223C16.4847 21.1462 16.4169 21.0177 15.5286 20.9297C14.7895 20.8552 14.3284 20.6928 14.3284 20.1038C14.3284 19.5555 14.7895 19.2305 15.5625 19.2305C16.4305 19.2305 16.8577 19.5284 16.912 20.1782C16.912 20.1986 16.9052 20.2189 16.8916 20.2392C16.8781 20.2527 16.8577 20.2663 16.8374 20.2663H16.4779C16.4441 20.2663 16.4101 20.2392 16.4034 20.2053C16.322 19.833 16.1118 19.7111 15.5557 19.7111C14.9319 19.7111 14.8573 19.9278 14.8573 20.0902C14.8573 20.2866 14.9454 20.3475 15.7863 20.4558C16.6204 20.5641 17.0137 20.7198 17.0137 21.302C17.0137 21.8977 16.5187 22.2362 15.6643 22.2362Z" fill="black"> </path> <path d="M19.5706 18.9597C19.5706 19.244 19.3333 19.481 19.0485 19.481C18.7636 19.481 18.5264 19.2507 18.5264 18.9597C18.5264 18.6618 18.7704 18.4385 19.0485 18.4385C19.3265 18.4385 19.5706 18.6686 19.5706 18.9597ZM18.6077 18.9597C18.6077 19.2034 18.8044 19.3997 19.0417 19.3997C19.2859 19.3997 19.4825 19.1967 19.4825 18.9597C19.4825 18.716 19.2859 18.5264 19.0417 18.5264C18.8111 18.5264 18.6077 18.716 18.6077 18.9597ZM18.8519 18.6686H19.0553C19.1231 18.6686 19.2587 18.6686 19.2587 18.8243C19.2587 18.9326 19.1909 18.9529 19.1502 18.9664C19.2316 18.9732 19.2384 19.0274 19.2451 19.1019C19.2519 19.1493 19.2587 19.2304 19.2722 19.2575H19.1502C19.1502 19.2304 19.1298 19.0815 19.1298 19.0748C19.1231 19.0409 19.1095 19.0274 19.0688 19.0274H18.9672V19.2643H18.8519V18.6686ZM18.9603 18.9258H19.0485C19.1231 18.9258 19.1366 18.8716 19.1366 18.8446C19.1366 18.7634 19.0824 18.7634 19.0485 18.7634H18.9535V18.9258H18.9603Z" fill="black"> </path> <path clip-rule="evenodd" d="M6.43536 12.1766C6.43536 12.0548 6.36754 11.9397 6.25904 11.8788L3.39059 10.2202C3.34313 10.1932 3.28887 10.1796 3.23463 10.1729C3.22785 10.1729 3.20751 10.1729 3.20751 10.1729C3.15325 10.1729 3.09901 10.1932 3.05154 10.2202L0.176311 11.872C0.067812 11.9329 0 12.048 0 12.1766L0.00678119 16.6174C0.00678119 16.6783 0.0406871 16.7393 0.0949364 16.7663C0.149187 16.8002 0.216998 16.8002 0.264466 16.7663L1.97332 15.7915C2.08183 15.7306 2.14964 15.6155 2.14964 15.4936V13.4154C2.14964 13.2936 2.21745 13.1785 2.32595 13.1176L3.05154 12.6979C3.10579 12.664 3.16682 12.6505 3.22785 12.6505C3.28887 12.6505 3.34991 12.664 3.39738 12.6979L4.12297 13.1176C4.23147 13.1785 4.29927 13.2936 4.29927 13.4154V15.4936C4.29927 15.6155 4.36709 15.7306 4.47559 15.7915L6.17089 16.7663C6.22513 16.8002 6.29295 16.8002 6.3472 16.7663C6.40144 16.7393 6.43536 16.6783 6.43536 16.6174V12.1766Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M20.2551 6.06425C20.201 6.03718 20.1332 6.03718 20.0857 6.06425C20.0314 6.0981 19.9975 6.15226 19.9975 6.21318V10.6133C19.9975 10.654 19.9771 10.6946 19.9364 10.7217C19.8958 10.742 19.8551 10.742 19.8144 10.7217L19.0956 10.3087C18.9871 10.2478 18.8582 10.2478 18.7498 10.3087L15.8746 11.9673C15.766 12.0282 15.6982 12.1433 15.6982 12.2651V15.5754C15.6982 15.6973 15.766 15.8123 15.8746 15.8732L18.7498 17.5318C18.8582 17.5927 18.9871 17.5927 19.0956 17.5318L21.9708 15.8732C22.0793 15.8123 22.1471 15.6973 22.1471 15.5754V7.32338C22.1471 7.19476 22.0793 7.07968 21.9708 7.01875L20.2551 6.06425ZM19.9907 14.4855C19.9907 14.5194 19.9771 14.5464 19.9501 14.56L18.9667 15.1286C18.9397 15.1421 18.9057 15.1421 18.8786 15.1286L17.8953 14.56C17.8682 14.5464 17.8547 14.5126 17.8547 14.4855V13.3482C17.8547 13.3144 17.8682 13.2873 17.8953 13.2738L18.8786 12.7051C18.9057 12.6916 18.9397 12.6916 18.9667 12.7051L19.9501 13.2738C19.9771 13.2873 19.9907 13.3212 19.9907 13.3482V14.4855Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M29.8235 13.3214C29.932 13.2605 29.9931 13.1454 29.9931 13.0235V12.218C29.9931 12.0961 29.9253 11.981 29.8235 11.9201L26.9687 10.2683C26.8602 10.2074 26.7314 10.2074 26.6228 10.2683L23.7476 11.9269C23.6391 11.9878 23.5713 12.1029 23.5713 12.2247V15.535C23.5713 15.6569 23.6391 15.772 23.7476 15.8328L26.6025 17.4575C26.7109 17.5185 26.8398 17.5185 26.9415 17.4575L28.6707 16.4963C28.725 16.4692 28.7589 16.4083 28.7589 16.3474C28.7589 16.2864 28.725 16.2255 28.6707 16.1984L25.782 14.5399C25.7277 14.506 25.6938 14.4519 25.6938 14.391V13.3552C25.6938 13.2943 25.7277 13.2334 25.782 13.2063L26.6839 12.6918C26.7381 12.658 26.8059 12.658 26.8602 12.6918L27.7621 13.2063C27.8163 13.2402 27.8502 13.2943 27.8502 13.3552V14.1676C27.8502 14.2285 27.8841 14.2894 27.9384 14.3165C27.9927 14.3504 28.0605 14.3504 28.1147 14.3165L29.8235 13.3214Z" fill="black" fill-rule="evenodd"> </path> <path clip-rule="evenodd" d="M26.7521 13.1654C26.7724 13.1519 26.7996 13.1519 26.8199 13.1654L27.3692 13.4836C27.3895 13.4971 27.4031 13.5174 27.4031 13.5445V14.1809C27.4031 14.2079 27.3895 14.2282 27.3692 14.2418L26.8199 14.5599C26.7996 14.5735 26.7724 14.5735 26.7521 14.5599L26.2028 14.2418C26.1825 14.2282 26.1689 14.2079 26.1689 14.1809V13.5445C26.1689 13.5174 26.1825 13.4971 26.2028 13.4836L26.7521 13.1654Z" fill="#5FA04E" fill-rule="evenodd"> </path> <path d="M11.2331 10.2292C11.1227 10.1671 10.9917 10.1671 10.8814 10.2292L7.97807 11.9053C7.86772 11.9673 7.80566 12.0846 7.80566 12.2088V15.5679C7.80566 15.692 7.87462 15.8092 7.97807 15.8714L10.8814 17.5474C10.9917 17.6095 11.1227 17.6095 11.2331 17.5474L14.1364 15.8714C14.2467 15.8092 14.3088 15.692 14.3088 15.5679V12.2088C14.3088 12.0846 14.2398 11.9673 14.1364 11.9053L11.2331 10.2292Z" fill="black"> </path> <path d="M14.1432 11.9059L11.2261 10.2298C11.1985 10.216 11.164 10.2022 11.1365 10.1953L7.875 15.7825C7.90258 15.817 7.94609 15.8673 7.98056 15.888L10.8813 17.548C10.9641 17.5963 11.0606 17.6101 11.1503 17.5825L14.219 11.968C14.1983 11.9404 14.1708 11.9197 14.1432 11.9059Z" fill="black"> </path> <path d="M14.136 15.8715C14.2187 15.8231 14.2933 15.7327 14.2933 15.6236L11.1154 10.1879C11.0326 10.1741 10.943 10.181 10.8671 10.2293L7.9707 11.8985L11.0947 17.5958C11.1361 17.5889 11.1843 17.5751 11.2257 17.5544L14.136 15.8715Z" fill="url(#:r19l:paint2)"> </path> </g> </g> </g> <defs> <lineargradient gradientunits="userSpaceOnUse" id=":r19l:paint0" x1="12.2396" x2="9.61385" y1="11.4775" y2="16.8331"> <stop stop-color="#3F873F"> </stop> <stop offset="0.3296" stop-color="#3F8B3D"> </stop> <stop offset="0.6367" stop-color="#3E9638"> </stop> <stop offset="0.9341" stop-color="#3DA92E"> </stop> <stop offset="1" stop-color="#3DAE2B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19l:paint1" x1="10.6159" x2="17.9826" y1="14.2811" y2="8.83932"> <stop offset="0.1376" stop-color="#3F873F"> </stop> <stop offset="0.4016" stop-color="#52A044"> </stop> <stop offset="0.7129" stop-color="#64B749"> </stop> <stop offset="0.9081" stop-color="#6ABF4B"> </stop> </lineargradient> <lineargradient gradientunits="userSpaceOnUse" id=":r19l:paint2" x1="7.69907" x2="14.4172" y1="13.8874" y2="13.8874"> <stop offset="0.0919165" stop-color="#6ABF4B"> </stop> <stop offset="0.2871" stop-color="#64B749"> </stop> <stop offset="0.5984" stop-color="#52A044"> </stop> <stop offset="0.8624" stop-color="#3F873F"> </stop> </lineargradient> <clippath id="clip0_2131_12968"> <rect fill="white" height="18.427" transform="translate(0 6)" width="30"> </rect> </clippath> </defs> </svg> <div class="leafygreen-ui-obh8q1"> <div class="lg-ui-select-menu-0000 leafygreen-ui-17aj16e" data-lgid="lg-select-button_text"> Node.js </div> </div> <svg alt="" aria-hidden="true" class="leafygreen-ui-fn50nl" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M8.67903 10.7962C8.45271 11.0679 8.04729 11.0679 7.82097 10.7962L4.63962 6.97649C4.3213 6.59428 4.5824 6 5.06866 6L11.4313 6C11.9176 6 12.1787 6.59428 11.8604 6.97649L8.67903 10.7962Z" fill="currentColor"> </path> </svg> </div> </button> <div aria-live="polite" aria-relevant="all" class="leafygreen-ui-11ydt2g" data-lgid="lg-form_field-feedback" data-testid="lg-form_field-feedback"> </div> </div> </div> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/administration/self-managed-configuration-and-maintenance/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Configure and Maintain a Self-Managed Deployment <a class="headerlink leafygreen-ui-1kepx47" href="#configure-and-maintain-a-self-managed-deployment" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="configure-and-maintain-a-self-managed-deployment"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> These documents provide instructions on how to configure and administer a self-managed MongoDB database. </p> <dl> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/configuration/#std-label-configuration-file"> Run-time Database Configuration for Self-Managed Deployments </a> </dt> <dd class="css-1ufxuu7"> Outlines common MongoDB configurations and examples of best-practice configurations for common use cases. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/upgrade-revision/#std-label-upgrade-to-latest-revision"> Upgrade to the Latest Self-Managed Patch Release of MongoDB </a> </dt> <dd class="css-1ufxuu7"> Upgrade a MongoDB deployment to a different patch release within the same major release series. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-mongodb-processes/"> Configure Self-Managed <code class="leafygreen-ui-1l06pbn"> mongod </code> Processes </a> </dt> <dd class="css-1ufxuu7"> Start, configure, and manage running <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#std-label-configuration-options"> Self-Managed Configuration File Options </a> </dt> <dd class="css-1ufxuu7"> Full documentation of the configuration file and available run-time operations. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#std-label-server-parameters"> MongoDB Server Parameters for a Self-Managed Deployment </a> </dt> <dd class="css-1ufxuu7"> Documentation of all <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> parameters that are available in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setParameter/#mongodb-dbcommand-dbcmd.setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> (command) and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> run-time interface. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/cluster-parameters/#std-label-cluster-parameters"> Cluster Parameters for a Self-Managed Deployment </a> </dt> <dd class="css-1ufxuu7"> Documentation of all <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> parameters that are available in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setClusterParameter/#mongodb-dbcommand-dbcmd.setClusterParameter"> <code class="leafygreen-ui-1l06pbn"> setClusterParameter </code> . </a> </dd> </dl> </section>
https://www.mongodb.com/docs/manual/core/indexes/index-types/geospatial/geohaystack/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> geoHaystack Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#geohaystack-indexes" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="geohaystack-indexes"> </div> </a> </h1> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Removed in MongoDB 5.0 </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB 5.0 removes the deprecated <code class="leafygreen-ui-1l06pbn"> geoHaystack </code> index and <code class="leafygreen-ui-1l06pbn"> geoSearch </code> command. Use a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index"> 2d index </a> with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/geoNear/#mongodb-pipeline-pipe.-geoNear"> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </a> or one of the supported <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query-geospatial/#std-label-geospatial-query-selectors"> geospatial query operators </a> instead. </p> <p class="leafygreen-ui-1kp3ins"> Upgrading your MongoDB instance to 5.0 and setting <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-view-fcv"> featureCompatibilityVersion </a> to <code class="leafygreen-ui-1l06pbn"> 5.0 </code> will delete any pre-existing <code class="leafygreen-ui-1l06pbn"> geoHaystack </code> indexes. </p> </div> </div> </section>
https://www.mongodb.com/docs/manual/tutorial/build-indexes-on-sharded-clusters/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Rolling Index Builds on Sharded Clusters <a class="headerlink leafygreen-ui-1kepx47" href="#rolling-index-builds-on-sharded-clusters" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="rolling-index-builds-on-sharded-clusters"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#considerations" target="_self"> <span> Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#before-you-begin" target="_self"> <span> Before You Begin </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#procedure" target="_self"> <span> Procedure </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#additional-information" target="_self"> <span> Additional Information </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> Index builds can impact sharded cluster performance. By default, MongoDB builds indexes simultaneously on all data-bearing replica set members. Index builds on sharded clusters occur only on those shards which contain data for the collection being indexed. For workloads which cannot tolerate performance decrease due to index builds, consider using the following procedure to build indexes in a rolling fashion. </p> <p class="leafygreen-ui-1kp3ins"> Rolling index builds take at most one shard replica set member out at a time, starting with the secondary members, and builds the index on that member as a standalone. Rolling index builds require at least one replica set election per shard. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For information about creating indexes in Atlas, refer to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-ui/indexes/" target="_self"> <span> index management </span> </a> page in the Atlas documentation. </p> </div> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#considerations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="considerations"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Unique Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#unique-indexes" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="unique-indexes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To create <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-unique/#std-label-index-type-unique"> unique indexes </a> using the following procedure, you must stop all writes to the collection during this procedure. </p> <p class="leafygreen-ui-1kp3ins"> If you cannot stop all writes to the collection during this procedure, do not use the procedure on this page. Instead, build your unique index on the collection by issuing <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndex() </code> </a> on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> for a sharded cluster. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Oplog Size <a class="headerlink leafygreen-ui-1kepx47" href="#oplog-size" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="oplog-size"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Ensure that your <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog </a> is large enough to permit the indexing or re-indexing operation to complete without falling too far behind to catch up. See the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-oplog/#std-label-replica-set-oplog-sizing"> oplog sizing </a> documentation for additional information. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Before You Begin <a class="headerlink leafygreen-ui-1kepx47" href="#before-you-begin" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="before-you-begin"> </div> </a> </h2> <dl> <dt> For building unique indexes </dt> <dd class="css-1ufxuu7"> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To create <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-unique/#std-label-index-type-unique"> unique indexes </a> using the following procedure, you must stop all writes to the collection during the index build. Otherwise, you may end up with inconsistent data across the replica set members. If you cannot stop all writes to the collection, do not use the following procedure to create unique indexes. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If you cannot stop all writes to the collection, do not use the following procedure to create unique indexes. </p> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Before creating the index, validate that no documents in the collection violate the index constraints. If a collection is distributed across shards and a shard contains a chunk with duplicate documents, the create index operation may succeed on the shards without duplicates but not on the shard with duplicates. To avoid leaving inconsistent indexes across shards, you can issue the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.dropIndex/#mongodb-method-db.collection.dropIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </a> from a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> to drop the index from the collection. </p> </li> </ol> </dd> </dl> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-directShardOperations"> <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> </a> role to perform maintenance operations that require you to execute commands directly against a shard. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Running commands using the <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> role can cause your cluster to stop working correctly and may cause data corruption. Only use the <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> role for maintenance purposes or under the guidance of MongoDB support. Once you are done performing maintenance operations, stop using the <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> role. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#procedure" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="procedure"> </div> </a> </h2> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The following procedure to build indexes in a rolling fashion applies to sharded clusters deployments, and not replica set deployments. For the procedure for replica sets, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/build-indexes-on-replica-sets/"> Rolling Index Builds on Replica Sets </a> instead. </p> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> A. Stop the Balancer <a class="headerlink leafygreen-ui-1kepx47" href="#a.-stop-the-balancer" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="a.-stop-the-balancer"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Connect <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance in the sharded cluster, and run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.stopBalancer/#mongodb-method-sh.stopBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.stopBalancer() </code> </a> to disable the balancer: <a class="footnote-reference header-buffer" href="#footnote-autosplit-stop" id="ref-autosplit-stop-id1"> [ <!-- --> 1 <!-- --> ] </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.stopBalancer()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">stopBalancer</span>(<!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If a migration is in progress, the system will complete the in-progress migration before stopping the balancer. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> To verify that the balancer is disabled, run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.getBalancerState/#mongodb-method-sh.getBalancerState"> <code class="leafygreen-ui-1l06pbn"> sh.getBalancerState() </code> </a> , which returns false if the balancer is disabled: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.getBalancerState()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">getBalancerState</span>(<!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <table class="header-buffer leafygreen-ui-rbqgrl" frame="void" id="footnote-autosplit-stop" rules="none"> <colgroup> <col/> </colgroup> <tbody valign="top"> <tr> <td class="leafygreen-ui-17r2xs0"> [ <a href="#ref-autosplit-stop-id1"> 1 </a> ] </td> <td class="leafygreen-ui-17r2xs0"> <!-- --> Starting in MongoDB 6.0.3, automatic chunk splitting is not performed. This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation. <!-- --> In MongoDB versions earlier than 6.0.3, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.stopBalancer/#mongodb-method-sh.stopBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.stopBalancer() </code> </a> also disables auto-splitting for the sharded cluster. </td> </tr> </tbody> </table> <span class="leafygreen-ui-1qnjd6d" id="std-label-build-indexes-sharded-cluster-distribution"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> B. Determine the Distribution of the Collection <a class="headerlink leafygreen-ui-1kepx47" href="#b.-determine-the-distribution-of-the-collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="b.-determine-the-distribution-of-the-collection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> From <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> connected to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , refresh the cached routing table for that <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> to avoid returning stale distribution information for the collection. Once refreshed, run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.getShardDistribution/#mongodb-method-db.collection.getShardDistribution"> <code class="leafygreen-ui-1l06pbn"> db.collection.getShardDistribution() </code> </a> for the collection you wish to build the index. </p> <p class="leafygreen-ui-1kp3ins"> For example, if you want to create an ascending index on the <code class="leafygreen-ui-1l06pbn"> records </code> collection in the <code class="leafygreen-ui-1l06pbn"> test </code> database: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { flushRouterConfig: \"test.records\" } );\ndb.records.getShardDistribution();","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">flushRouterConfig</span>: <span class="lg-highlight-string">"test.records"</span> } )<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">records</span>.<span class="lg-highlight-title lg-highlight-function">getShardDistribution</span>(<!-- -->)<!-- -->;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The method outputs the shard distribution. For example, consider a sharded cluster with 3 shards <code class="leafygreen-ui-1l06pbn"> shardA </code> , <code class="leafygreen-ui-1l06pbn"> shardB </code> , and <code class="leafygreen-ui-1l06pbn"> shardC </code> and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.getShardDistribution/#mongodb-method-db.collection.getShardDistribution"> <code class="leafygreen-ui-1l06pbn"> db.collection.getShardDistribution() </code> </a> returns the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"Shard shardA at shardA/s1-mongo1.example.net:27018,s1-mongo2.example.net:27018,s1-mongo3.example.net:27018\n data : 1KiB docs : 50 chunks : 1\n estimated data per chunk : 1KiB\n estimated docs per chunk : 50\n\nShard shardC at shardC/s3-mongo1.example.net:27018,s3-mongo2.example.net:27018,s3-mongo3.example.net:27018\n data : 1KiB docs : 50 chunks : 1\n estimated data per chunk : 1KiB\n estimated docs per chunk : 50\n\nTotals\n data : 3KiB docs : 100 chunks : 2\n Shard shardA contains 50% data, 50% docs in cluster, avg obj size on shard : 40B\n Shard shardC contains 50% data, 50% docs in cluster, avg obj size on shard : 40B"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">Shard shardA at shardA/s1-mongo1.example.net:27018,s1-mongo2.example.net:27018,s1-mongo3.example.net:27018</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> data : 1KiB docs : 50 chunks : 1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> estimated data per chunk : 1KiB</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> estimated docs per chunk : 50</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">Shard shardC at shardC/s3-mongo1.example.net:27018,s3-mongo2.example.net:27018,s3-mongo3.example.net:27018</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> data : 1KiB docs : 50 chunks : 1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> estimated data per chunk : 1KiB</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> estimated docs per chunk : 50</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">Totals</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> data : 3KiB docs : 100 chunks : 2</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> Shard shardA contains 50% data, 50% docs in cluster, avg obj size on shard : 40B</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> Shard shardC contains 50% data, 50% docs in cluster, avg obj size on shard : 40B</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> From the output, you only build the indexes for <code class="leafygreen-ui-1l06pbn"> test.records </code> on <code class="leafygreen-ui-1l06pbn"> shardA </code> and <code class="leafygreen-ui-1l06pbn"> shardC </code> . </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-tutorial-index-on-affected-shards"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> C. Build Indexes on the Shards That Contain Collection Chunks <a class="headerlink leafygreen-ui-1kepx47" href="#c.-build-indexes-on-the-shards-that-contain-collection-chunks" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="c.-build-indexes-on-the-shards-that-contain-collection-chunks"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> For each shard that contains chunks for the collection, follow the procedure to build the index on the shard. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-tutorial-index-on-sharded-clusters-stop-one-member"> </span> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> C1. Stop One Secondary and Restart as a Standalone <a class="headerlink leafygreen-ui-1kepx47" href="#c1.-stop-one-secondary-and-restart-as-a-standalone" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="c1.-stop-one-secondary-and-restart-as-a-standalone"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> For an affected shard, stop the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process associated with one of its secondary. Restart after making the following configuration updates: </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-13"> <div aria-label="Tabs to describe usage of command-line/config-file" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_bd319ik4j" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_1s6jj50xl" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Configuration File </div> </button> <button aria-controls="_ertey7khm" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_9a36nyusb" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Command-line Options </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_yiuq9grcm" class="" id="_tgi3w0lhj" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If you are using a configuration file, make the following configuration updates: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Change the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.port"> <code class="leafygreen-ui-1l06pbn"> net.port </code> </a> to a different port. <a class="footnote-reference header-buffer" href="#footnote-different-port" id="ref-different-port-id2"> [ <!-- --> 2 <!-- --> ] </a> Make a note of the original port setting as a comment. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Comment out the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> </a> option. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Comment out the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-sharding.clusterRole"> <code class="leafygreen-ui-1l06pbn"> sharding.clusterRole </code> </a> option. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Set parameter <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.skipShardingConfigurationChecks"> <code class="leafygreen-ui-1l06pbn"> skipShardingConfigurationChecks </code> </a> to <code class="leafygreen-ui-1l06pbn"> true </code> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> section. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Set parameter <code class="leafygreen-ui-1l06pbn"> disableLogicalSessionCacheRefresh </code> to <code class="leafygreen-ui-1l06pbn"> true </code> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> section. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For example, for a shard replica set member, the updated configuration file will include content like the following example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"net:\n bindIp: localhost,&lt;hostname(s)|ip&gt;\n port: 27218\n# port: 27018\n#replication:\n# replSetName: shardA\n#sharding:\n# clusterRole: shardsvr\nsetParameter:\n skipShardingConfigurationChecks: true\n disableLogicalSessionCacheRefresh: true","programmingLanguage":"YAML"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light yaml leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">net:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bindIp:</span> <span class="lg-highlight-string">localhost,&lt;hostname(s)|ip</span> <span class="lg-highlight-string">address(es)&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">port:</span> <span class="lg-highlight-number">27218</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment"># port: 27018</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">#replication:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment"># replSetName: shardA</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment">#sharding:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-comment"># clusterRole: shardsvr</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">setParameter:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">skipShardingConfigurationChecks:</span> <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">disableLogicalSessionCacheRefresh:</span> <span class="lg-highlight-literal">true</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> And restart: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --config &lt;path&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --config &lt;path/To/ConfigFile&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Other settings (e.g. <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> storage.dbPath </code> </a> , etc.) remain the same. </p> </div> </div> </div> <div> <div aria-labelledby="_v6r9rlcnf" class="leafygreen-ui-38lglc" id="_vrbkihyuz" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If using command-line options, make the following configuration updates: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Modify <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--port"> <code class="leafygreen-ui-1l06pbn"> --port </code> </a> to a different port. <a class="footnote-reference header-buffer" href="#footnote-different-port" id="ref-different-port-id3"> [ <!-- --> 2 <!-- --> ] </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Remove <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--replSet"> <code class="leafygreen-ui-1l06pbn"> --replSet </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Remove <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--shardsvr"> <code class="leafygreen-ui-1l06pbn"> --shardsvr </code> </a> if a shard member and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--configsvr"> <code class="leafygreen-ui-1l06pbn"> --configsvr </code> </a> if a config server member. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Set parameter <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.skipShardingConfigurationChecks"> <code class="leafygreen-ui-1l06pbn"> skipShardingConfigurationChecks </code> </a> to <code class="leafygreen-ui-1l06pbn"> true </code> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> --setParameter </code> </a> option. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Set parameter <code class="leafygreen-ui-1l06pbn"> disableLogicalSessionCacheRefresh </code> to <code class="leafygreen-ui-1l06pbn"> true </code> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--setParameter"> <code class="leafygreen-ui-1l06pbn"> --setParameter </code> </a> option. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For example, restart your shard replica set member without the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--replSet"> <code class="leafygreen-ui-1l06pbn"> --replSet </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--shardsvr"> <code class="leafygreen-ui-1l06pbn"> --shardsvr </code> </a> options. Specify a new port number and set both the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.skipShardingConfigurationChecks"> <code class="leafygreen-ui-1l06pbn"> skipShardingConfigurationChecks </code> </a> and <code class="leafygreen-ui-1l06pbn"> disableLogicalSessionCacheRefresh </code> parameters to true: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --port 27218 --setParameter skipShardingConfigurationChecks=true --setParameter disableLogicalSessionCacheRefresh=true","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --port 27218 --setParameter skipShardingConfigurationChecks=<span class="lg-highlight-literal">true</span> --setParameter disableLogicalSessionCacheRefresh=<span class="lg-highlight-literal">true</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Other settings (e.g. <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--dbpath"> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> </a> , etc.) remain the same. </p> </div> </div> </div> </div> </div> <table class="header-buffer leafygreen-ui-rbqgrl" frame="void" id="footnote-different-port" rules="none"> <colgroup> <col/> </colgroup> <tbody valign="top"> <tr> <td class="leafygreen-ui-17r2xs0"> [ <!-- --> 2 <!-- --> ] </td> <td class="leafygreen-ui-17r2xs0"> <em> ( <a href="#ref-different-port-id2"> 1 </a> , <a href="#ref-different-port-id3"> 2 </a> ) </em> <!-- --> By running the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> on a different port, you ensure that the other members of the replica set and all clients will not contact the member while you are building the index. </td> </tr> </tbody> </table> <span class="leafygreen-ui-1qnjd6d" id="std-label-tutorial-index-on-sharded-clusters-build-index"> </span> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> C2. Build the Index <a class="headerlink leafygreen-ui-1kepx47" href="#c2.-build-the-index" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="c2.-build-the-index"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Connect directly to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance running as a standalone on the new port and create the new index for this instance. </p> <p class="leafygreen-ui-1kp3ins"> For example, connect <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to the instance, and use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndex() </code> </a> method to create an ascending index on the <code class="leafygreen-ui-1l06pbn"> username </code> field of the <code class="leafygreen-ui-1l06pbn"> records </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.records.createIndex( { username: 1 } )","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.records.createIndex( { username: 1 } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-tutorial-index-on-sharded-clusters-restart-mongod"> </span> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> C3. Restart the Program <code class="leafygreen-ui-1l06pbn"> mongod </code> as a Replica Set Member <a class="headerlink leafygreen-ui-1kepx47" href="#c3.-restart-the-program-mongod-as-a-replica-set-member" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="c3.-restart-the-program-mongod-as-a-replica-set-member"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> When the index build completes, shutdown the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance. Undo the configuration changes made when starting as a standalone to return to its original configuration and restart. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Be sure to remove the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.skipShardingConfigurationChecks"> <code class="leafygreen-ui-1l06pbn"> skipShardingConfigurationChecks </code> </a> parameter and <code class="leafygreen-ui-1l06pbn"> disableLogicalSessionCacheRefresh </code> parameter. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For example, to restart your replica set shard member: </p> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-16"> <div aria-label="Tabs to describe usage of command-line/config-file" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_fjr3esgqn" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_77sgjo1pm" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> Configuration File </div> </button> <button aria-controls="_596q05xp7" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_i3g7vxerb" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> Command-line Options </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_g9sq4vt94" class="" id="_gz995j3md" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If you are using a configuration file: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Revert to the original port number. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uncomment the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uncomment the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-sharding.clusterRole"> <code class="leafygreen-ui-1l06pbn"> sharding.clusterRole </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Remove parameter <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.skipShardingConfigurationChecks"> <code class="leafygreen-ui-1l06pbn"> skipShardingConfigurationChecks </code> </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> section. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Remove parameter <code class="leafygreen-ui-1l06pbn"> disableLogicalSessionCacheRefresh </code> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-setParameter"> <code class="leafygreen-ui-1l06pbn"> setParameter </code> </a> section. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"net:\n bindIp: localhost,&lt;hostname(s)|ip&gt;\n port: 27018\nreplication:\n replSetName: shardA\nsharding:\n clusterRole: shardsvr","programmingLanguage":"YAML"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light yaml leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">net:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">bindIp:</span> <span class="lg-highlight-string">localhost,&lt;hostname(s)|ip</span> <span class="lg-highlight-string">address(es)&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">port:</span> <span class="lg-highlight-number">27018</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">replication:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">replSetName:</span> <span class="lg-highlight-string">shardA</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">sharding:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">clusterRole:</span> <span class="lg-highlight-string">shardsvr</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Other settings (e.g. <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> storage.dbPath </code> </a> , etc.) remain the same. </p> <p class="leafygreen-ui-1kp3ins"> And restart: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --config &lt;path&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --config &lt;path/To/ConfigFile&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_3i4bjzc3e" class="leafygreen-ui-38lglc" id="_n8pppznik" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <p class="leafygreen-ui-1kp3ins"> If you are using command-line options: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Revert to the original port number. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--replSet"> <code class="leafygreen-ui-1l06pbn"> --replSet </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--shardsvr"> <code class="leafygreen-ui-1l06pbn"> --shardsvr </code> </a> if a shard member or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--configsvr"> <code class="leafygreen-ui-1l06pbn"> --configsvr </code> </a> if a config server member. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Remove parameter <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.skipShardingConfigurationChecks"> <code class="leafygreen-ui-1l06pbn"> skipShardingConfigurationChecks </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Remove parameter <code class="leafygreen-ui-1l06pbn"> disableLogicalSessionCacheRefresh </code> . </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --port 27018 --replSet shardA --shardsvr","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --port 27018 --replSet shardA --shardsvr</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Other settings (e.g. <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--dbpath"> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> </a> , etc.) remain the same. </p> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Allow replication to catch up on this member. </p> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> C4. Repeat the Procedure for the Remaining Secondaries for the Shard <a class="headerlink leafygreen-ui-1kepx47" href="#c4.-repeat-the-procedure-for-the-remaining-secondaries-for-the-shard" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="c4.-repeat-the-procedure-for-the-remaining-secondaries-for-the-shard"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Once the member catches up with the other members of the set, repeat the procedure one member at a time for the remaining secondary members for the shard: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-tutorial-index-on-sharded-clusters-stop-one-member" target="_self"> <span> C1. Stop One Secondary and Restart as a Standalone </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-tutorial-index-on-sharded-clusters-build-index" target="_self"> <span> C2. Build the Index </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-tutorial-index-on-sharded-clusters-restart-mongod" target="_self"> <span> C3. Restart the Program <code class="leafygreen-ui-1l06pbn"> mongod </code> as a Replica Set Member </span> </a> </p> </li> </ol> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> C5. Build the Index on the Primary <a class="headerlink leafygreen-ui-1kepx47" href="#c5.-build-the-index-on-the-primary" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="c5.-build-the-index-on-the-primary"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> When all the secondaries for the shard have the new index, step down the primary for the shard, restart it as a standalone using the procedure described above, and build the index on the former primary: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.stepDown/#mongodb-method-rs.stepDown"> <code class="leafygreen-ui-1l06pbn"> rs.stepDown() </code> </a> method in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to step down the primary. Upon successful stepdown, the current primary becomes a secondary and the replica set members elect a new primary. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-tutorial-index-on-sharded-clusters-stop-one-member" target="_self"> <span> C1. Stop One Secondary and Restart as a Standalone </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-tutorial-index-on-sharded-clusters-build-index" target="_self"> <span> C2. Build the Index </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-tutorial-index-on-sharded-clusters-restart-mongod" target="_self"> <span> C3. Restart the Program <code class="leafygreen-ui-1l06pbn"> mongod </code> as a Replica Set Member </span> </a> </p> </li> </ol> </section> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> D. Repeat for the Other Affected Shards <a class="headerlink leafygreen-ui-1kepx47" href="#d.-repeat-for-the-other-affected-shards" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="d.-repeat-for-the-other-affected-shards"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Once you finish building the index for a shard, repeat <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-tutorial-index-on-affected-shards" target="_self"> <span> C. Build Indexes on the Shards That Contain Collection Chunks </span> </a> for the other affected shards. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> E. Restart the Balancer <a class="headerlink leafygreen-ui-1kepx47" href="#e.-restart-the-balancer" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="e.-restart-the-balancer"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Once you finish the rolling index build for the affected shards, restart the balancer. </p> <p class="leafygreen-ui-1kp3ins"> Connect <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance in the sharded cluster, and run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.startBalancer/#mongodb-method-sh.startBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.startBalancer() </code> </a> : <a class="footnote-reference header-buffer" href="#footnote-autosplit-start" id="ref-autosplit-start-id4"> [ <!-- --> 3 <!-- --> ] </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.startBalancer()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">startBalancer</span>(<!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <table class="header-buffer leafygreen-ui-rbqgrl" frame="void" id="footnote-autosplit-start" rules="none"> <colgroup> <col/> </colgroup> <tbody valign="top"> <tr> <td class="leafygreen-ui-17r2xs0"> [ <a href="#ref-autosplit-start-id4"> 3 </a> ] </td> <td class="leafygreen-ui-17r2xs0"> <!-- --> Starting in MongoDB 6.0.3, automatic chunk splitting is not performed. This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation. <!-- --> In MongoDB versions earlier than 6.0.3, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.startBalancer/#mongodb-method-sh.startBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.startBalancer() </code> </a> also enables auto-splitting for the sharded cluster. </td> </tr> </tbody> </table> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Additional Information <a class="headerlink leafygreen-ui-1kepx47" href="#additional-information" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="additional-information"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A sharded collection has an inconsistent index if the collection does not have the exact same indexes (including the index options) on each shard that contains chunks for the collection. Although inconsistent indexes should not occur during normal operations, inconsistent indexes can occur, such as: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When a user is creating an index with a <code class="leafygreen-ui-1l06pbn"> unique </code> key constraint and one shard contains a chunk with duplicate documents. In such cases, the create index operation may succeed on the shards without duplicates but not on the shard with duplicates. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When a user is creating an index across the shards in a rolling manner but either fails to build the index for an associated shard or incorrectly builds an index with different specification. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-config-servers/#std-label-sharding-config-server"> config server </a> primary periodically checks for index inconsistencies across the shards for sharded collections. To configure these periodic checks, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.enableShardedIndexConsistencyCheck"> <code class="leafygreen-ui-1l06pbn"> enableShardedIndexConsistencyCheck </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.shardedIndexConsistencyCheckIntervalMS"> <code class="leafygreen-ui-1l06pbn"> shardedIndexConsistencyCheckIntervalMS </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The command <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-dbcommand-dbcmd.serverStatus"> <code class="leafygreen-ui-1l06pbn"> serverStatus </code> </a> returns the field <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/serverStatus/#mongodb-serverstatus-serverstatus.shardedIndexConsistency"> <code class="leafygreen-ui-1l06pbn"> shardedIndexConsistency </code> </a> to report on index inconsistencies when run on the config server primary. </p> <p class="leafygreen-ui-1kp3ins"> To check if a sharded collection has inconsistent indexes, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-indexes/#std-label-manage-indexes-find-inconsistent-indexes"> Find Inconsistent Indexes Across Shards <!-- --> . </a> </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/change-events/refineCollectionShardKey/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> refineCollectionShardKey Event <a class="headerlink leafygreen-ui-1kepx47" href="#refinecollectionshardkey-event" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="refinecollectionshardkey-event"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#summary" target="_self"> <span> Summary </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#description" target="_self"> <span> Description </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Summary <a class="headerlink leafygreen-ui-1kepx47" href="#summary" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="summary"> </div> </a> </h2> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> refineCollectionShardKey </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-refineCollectionShardKey" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-refineCollectionShardKey"> </div> </a> </dt> <dd> <div> <p> <em> New <!-- --> in version <!-- --> 6.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> A <code class="leafygreen-ui-1l06pbn"> refineCollectionShardKey </code> event occurs when a collection's shard key is modified. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Description <a class="headerlink leafygreen-ui-1kepx47" href="#description" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="description"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:60%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> _id </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--id"> </span> <p class="leafygreen-ui-1kp3ins"> A <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-BSON"> BSON </a> object which serves as an identifier for the change stream event. This value is used as the <code class="leafygreen-ui-1l06pbn"> resumeToken </code> for the <code class="leafygreen-ui-1l06pbn"> resumeAfter </code> parameter when resuming a change stream. The <code class="leafygreen-ui-1l06pbn"> _id </code> object has the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_data\" : &lt;bindata|hex&gt;\n}"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "_data" : &lt;BinData|hex string&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> _data </code> type depends on the MongoDB versions and, in some cases, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-view-fcv"> feature compatibility version (fCV) </a> at the time of the change stream's opening or resumption. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/changeStreams/#std-label-change-stream-resume-token"> Resume Tokens </a> for the full list of <code class="leafygreen-ui-1l06pbn"> _data </code> types. </p> <p class="leafygreen-ui-1kp3ins"> For an example of resuming a change stream by <code class="leafygreen-ui-1l06pbn"> resumeToken </code> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/changeStreams/#std-label-change-stream-resume"> Resume a Change Stream <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> clusterTime </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Timestamp </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--clusterTime"> </span> <p class="leafygreen-ui-1kp3ins"> The timestamp from the oplog entry associated with the event. </p> <p class="leafygreen-ui-1kp3ins"> Change stream event notifications associated with a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions"> multi-document transaction </a> all have the same <code class="leafygreen-ui-1l06pbn"> clusterTime </code> value: the time when the transaction was committed. </p> <p class="leafygreen-ui-1kp3ins"> Events with the same <code class="leafygreen-ui-1l06pbn"> clusterTime </code> may not all relate to the same transaction. Some events don't relate to a transaction at all. Starting in MongoDB 8.0, this may be true for events on any deployment. In previous versions, this behavior was possible only for events on a sharded cluster. </p> <p class="leafygreen-ui-1kp3ins"> To identify events for a single transaction, you can use the combination of <code class="leafygreen-ui-1l06pbn"> lsid </code> and <code class="leafygreen-ui-1l06pbn"> txnNumber </code> in the change stream event document. </p> <div> <p> <em> Changed <!-- --> in version <!-- --> 8.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> collectionUUID </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> UUID </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--collectionUUID"> </span> <p class="leafygreen-ui-1kp3ins"> <span class="leafygreen-ui-vm4wms" tabindex="0"> UUID </span> identifying the collection where the change occurred. </p> <div> <p> <em> New <!-- --> in version <!-- --> 6.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> ns </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--ns"> </span> <p class="leafygreen-ui-1kp3ins"> The namespace (database and or collection) affected by the event. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> ns.coll </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> String </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--ns.coll"> </span> <p class="leafygreen-ui-1kp3ins"> The name of the collection where the event occurred. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> ns.db </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> String </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--ns.db"> </span> <p class="leafygreen-ui-1kp3ins"> The name of the database where the event occurred. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> operationDescription </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--operationDescription"> </span> <p class="leafygreen-ui-1kp3ins"> Additional information on the change operation. </p> <p class="leafygreen-ui-1kp3ins"> This document and its subfields only appears when the change stream uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/change-events/#std-label-change-streams-expanded-events"> expanded events <!-- --> . </a> </p> <div> <p> <em> New <!-- --> in version <!-- --> 6.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <code class="leafygreen-ui-1l06pbn"> operationDescription. </code> </div> <div class="line"> <code class="leafygreen-ui-1l06pbn"> shardKey </code> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--od.shardKey"> </span> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-shard-key/#std-label-shard-key"> shard key </a> for the collection where the change occurred. </p> <div> <p> <em> New <!-- --> in version <!-- --> 6.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <div class="line-block"> <div class="line"> <code class="leafygreen-ui-1l06pbn"> operationDescription. </code> </div> <div class="line"> <code class="leafygreen-ui-1l06pbn"> oldShardKey </code> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label--idref--od-oldShardKey"> </span> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-shard-key/#std-label-shard-key"> shard key </a> for the collection that changed. </p> <div> <p> <em> New <!-- --> in version <!-- --> 6.1 </em> . </p> </div> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example shows a <code class="leafygreen-ui-1l06pbn"> refineCollectionShardKey </code> event: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\": { &lt;resumetoken&gt; },\n \"operationType\": \"refineCollectionShardKey\",\n \"clusterTime\": Timestamp({ t: 1654894852, i: 52 }),\n \"collectionUUID\": UUID(\"98046a1a-b649-4e5b-9c75-67594221ce19\"),\n \"ns\": {\"db\": \"reshard_collection_event\", \"coll\": \"coll\"},\n \"operationDescription\": {\n \"shardKey\": {\"_id\": 1, akey: 1},\n \"oldShardKey\": {\"_id\": 1}\n }\n}","programmingLanguage":"JSON"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"_id"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span> &lt;ResumeToken&gt; <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"operationType"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"refineCollectionShardKey"</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"clusterTime"</span><span class="lg-highlight-punctuation">:</span> Timestamp(<span class="lg-highlight-punctuation">{</span> t<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">1654894852</span><span class="lg-highlight-punctuation">,</span> i<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">52</span> <span class="lg-highlight-punctuation">}</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"collectionUUID"</span><span class="lg-highlight-punctuation">:</span> UUID(<span class="lg-highlight-string">"98046a1a-b649-4e5b-9c75-67594221ce19"</span>)<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"ns"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span><span class="lg-highlight-attr">"db"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"reshard_collection_event"</span><span class="lg-highlight-punctuation">,</span> <span class="lg-highlight-attr">"coll"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-string">"coll"</span><span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"operationDescription"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"shardKey"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span><span class="lg-highlight-attr">"_id"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">1</span><span class="lg-highlight-punctuation">,</span> akey<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">1</span><span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">"oldShardKey"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span><span class="lg-highlight-attr">"_id"</span><span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">1</span><span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</span></td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/delete/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> delete <a class="headerlink leafygreen-ui-1kepx47" href="#delete" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="delete"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#command-fields" target="_self"> <span> Command Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#output" target="_self"> <span> Output </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> delete </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.delete" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-dbcommand-dbcmd.delete"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.delete" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> delete </code> </span> </a> command removes documents from a collection. A single <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.delete" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> delete </code> </span> </a> command can contain multiple delete specifications. The delete methods provided by the MongoDB drivers use this command internally. </p> <div> <p> <em> Changed <!-- --> in version <!-- --> 5.0 </em> . </p> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> In <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#std-program-mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , this command can also be run through the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.deleteOne/#mongodb-method-db.collection.deleteOne"> <code class="leafygreen-ui-1l06pbn"> deleteOne() </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.deleteMany/#mongodb-method-db.collection.deleteMany"> <code class="leafygreen-ui-1l06pbn"> deleteMany() </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findOneAndDelete/#mongodb-method-db.collection.findOneAndDelete"> <code class="leafygreen-ui-1l06pbn"> findOneAndDelete() </code> </a> helper methods <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> Helper methods are convenient for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#std-program-mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> users, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command. </p> </div> </div> <table class="css-11h39yh e1nex8bq0"> <colgroup> <col class="field-name"/> <col class="field-body"/> </colgroup> <tbody> <tr class="css-x8snli"> <th> Returns <!-- --> : </th> <td> A document that contains the status of the operation. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-delete-command-output" target="_self"> <span> Output </span> </a> for details. </td> </tr> </tbody> </table> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <span class="leafygreen-ui-1qnjd6d" id="std-label-delete-syntax"> </span> <p class="leafygreen-ui-1kp3ins"> The command has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":" db.runCommand(\n {\n delete: &lt;collection&gt;,\n deletes: [\n {\n q : &lt;query&gt;,\n limit : &lt;integer&gt;,\n collation: &lt;document&gt;,\n hint: &lt;document|string&gt;\n },\n ...\n ],\n comment: &lt;any&gt;,\n let: &lt;document&gt;, // Added in MongoDB 5.0\n ordered: &lt;boolean&gt;,\n writeConcern: { &lt;write&gt; },\n maxTimeMS: &lt;integer&gt;\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"> db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">delete</span>: &lt;<!-- -->collection<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">deletes</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->q <!-- -->: &lt;<!-- -->query<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->limit <!-- -->: &lt;<!-- -->integer<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collation</span>: &lt;<span class="lg-highlight-variable lg-highlight-language">document</span>&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">hint</span>: <!-- -->&lt;document|string&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> comment: &lt;any&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> let: &lt;document&gt;, // Added in MongoDB 5.0</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ordered: &lt;boolean&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> writeConcern: { &lt;write concern&gt; },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> maxTimeMS: &lt;integer&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Command Fields <a class="headerlink leafygreen-ui-1kepx47" href="#command-fields" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="command-fields"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command takes the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-delete-command-delete" target="_self"> <span> delete </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-delete-command-delete"> </span> <p class="leafygreen-ui-1kp3ins"> The name of the target collection. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-delete-command-deletes" target="_self"> <span> deletes </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> array </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-delete-command-deletes"> </span> <p class="leafygreen-ui-1kp3ins"> An array of one or more delete statements to perform in the named collection. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> comment </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> any </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. A user-provided comment to attach to this command. Once set, this comment appears alongside records of this command in the following locations: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-messages-ref"> mongod log messages </a> , in the <code class="leafygreen-ui-1l06pbn"> attr.command.cursor.comment </code> field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/database-profiler/#std-label-profiler"> Database profiler </a> output, in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/database-profiler/#mongodb-data-system.profile.command"> <code class="leafygreen-ui-1l06pbn"> command.comment </code> </a> field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-dbcommand-dbcmd.currentOp"> <code class="leafygreen-ui-1l06pbn"> currentOp </code> </a> output, in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-data-currentOp.command"> <code class="leafygreen-ui-1l06pbn"> command.comment </code> </a> field. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> A comment can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-bson-types"> BSON type </a> (string, integer, object, array, etc). </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-delete-let-syntax" target="_self"> <span> let </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-delete-let-syntax"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. </p> <p class="leafygreen-ui-1kp3ins"> Specifies a document with a list of variables. This allows you to improve command readability by separating the variables from the query text. </p> <p class="leafygreen-ui-1kp3ins"> The document syntax is: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n &lt;variable_name_1&gt;: &lt;expression_1&gt;,\n ...,\n &lt;variable_name_n&gt;: &lt;expression_n&gt;\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;<!-- -->variable_name_1<!-- -->&gt;<!-- -->: &lt;<!-- -->expression_1<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;<!-- -->variable_name_n<!-- -->&gt;<!-- -->: &lt;<!-- -->expression_n<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The variable is set to the value returned by the expression, and cannot be changed afterwards. </p> <p class="leafygreen-ui-1kp3ins"> To access the value of a variable in the command, use the double dollar sign prefix ( <code class="leafygreen-ui-1l06pbn"> $$ </code> ) together with your variable name in the form <code class="leafygreen-ui-1l06pbn"> $$&lt;variable_name&gt; </code> . For example: <code class="leafygreen-ui-1l06pbn"> $$targetTotal </code> . </p> <p class="leafygreen-ui-1kp3ins"> To use a variable to filter results, you must access the variable within the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/expr/#mongodb-query-op.-expr"> <code class="leafygreen-ui-1l06pbn"> $expr </code> </a> operator. </p> <p class="leafygreen-ui-1kp3ins"> For a complete example using <code class="leafygreen-ui-1l06pbn"> let </code> and variables, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-delete-let-example" target="_self"> <span> Use Variables in <code class="leafygreen-ui-1l06pbn"> let </code> . </span> </a> </p> <div> <p> <em> New <!-- --> in version <!-- --> 5.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-delete-command-ordered" target="_self"> <span> ordered </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-delete-command-ordered"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. If <code class="leafygreen-ui-1l06pbn"> true </code> , then when a delete statement fails, return without performing the remaining delete statements. If <code class="leafygreen-ui-1l06pbn"> false </code> , then when a delete statement fails, continue with the remaining delete statements, if any. Defaults to <code class="leafygreen-ui-1l06pbn"> true </code> . </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-delete-command-wc" target="_self"> <span> writeConcern </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-delete-command-wc"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. A document expressing the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern"> write concern </a> of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.delete" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> delete </code> </span> </a> command. Omit to use the default write concern. </p> <p class="leafygreen-ui-1kp3ins"> Do not explicitly set the write concern for the operation if run in a transaction. To use write concern with transactions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions-write-concern"> Transactions and Write Concern <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> maxTimeMS </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> non-negative integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. </p> <p class="leafygreen-ui-1kp3ins"> Specifies a time limit in milliseconds. If you do not specify a value for <code class="leafygreen-ui-1l06pbn"> maxTimeMS </code> , operations will not time out. A value of <code class="leafygreen-ui-1l06pbn"> 0 </code> explicitly specifies the default unbounded behavior. </p> <p class="leafygreen-ui-1kp3ins"> MongoDB terminates operations that exceed their allotted time limit using the same mechanism as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.killOp/#mongodb-method-db.killOp"> <code class="leafygreen-ui-1l06pbn"> db.killOp() </code> </a> . MongoDB only terminates an operation at one of its designated <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-interrupt-point"> interrupt points <!-- --> . </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> Each element of the <code class="leafygreen-ui-1l06pbn"> deletes </code> array contains the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-deletes-array-q" target="_self"> <span> q </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-deletes-array-q"> </span> <p class="leafygreen-ui-1kp3ins"> The query that matches documents to delete. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-deletes-array-limit" target="_self"> <span> limit </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-deletes-array-limit"> </span> <p class="leafygreen-ui-1kp3ins"> The number of matching documents to delete. Specify either a <code class="leafygreen-ui-1l06pbn"> 0 </code> to delete all matching documents or <code class="leafygreen-ui-1l06pbn"> 1 </code> to delete a single document. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-deletes-array-collation" target="_self"> <span> collation </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-deletes-array-collation"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. </p> <p class="leafygreen-ui-1kp3ins"> Specifies the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> collation </a> to use for the operation. </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> Collation </a> allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks. </p> <p class="leafygreen-ui-1kp3ins"> The collation option has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"collation: {\n locale: &lt;string&gt;,\n caseLevel: &lt;boolean&gt;,\n caseFirst: &lt;string&gt;,\n strength: &lt;int&gt;,\n numericOrdering: &lt;boolean&gt;,\n alternate: &lt;string&gt;,\n maxVariable: &lt;string&gt;,\n backwards: &lt;boolean&gt;\n}"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">collation: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> locale: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> caseLevel: &lt;boolean&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> caseFirst: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> strength: &lt;int&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> numericOrdering: &lt;boolean&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> alternate: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> maxVariable: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> backwards: &lt;boolean&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> When specifying collation, the <code class="leafygreen-ui-1l06pbn"> locale </code> field is mandatory; all other collation fields are optional. For descriptions of the fields, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation-document-fields"> Collation Document <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If the collation is unspecified but the collection has a default collation (see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createCollection/#mongodb-method-db.createCollection"> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </a> ), the operation uses the collation specified for the collection. </p> <p class="leafygreen-ui-1kp3ins"> If no collation is specified for the collection or for the operations, MongoDB uses the simple binary comparison used in prior versions for string comparisons. </p> <p class="leafygreen-ui-1kp3ins"> You cannot specify multiple collations for an operation. For example, you cannot specify different collations per field, or if performing a find with a sort, you cannot use one collation for the find and another for the sort. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-deletes-array-hint" target="_self"> <span> hint </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Document or string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-deletes-array-hint"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. A document or string that specifies the <a class="leafygreen-ui-tqgtui" href="/docs/manual/indexes/#std-label-indexes"> index </a> to use to support the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-deletes-array-q" target="_self"> <span> query predicate <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> The option can take an index specification document or the index name string. </p> <p class="leafygreen-ui-1kp3ins"> If you specify an index that does not exist, the operation errors. </p> <p class="leafygreen-ui-1kp3ins"> For an example, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-ex-delete-command-hint" target="_self"> <span> Specify <code class="leafygreen-ui-1l06pbn"> hint </code> for Delete Operations <!-- --> . </span> </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sharded Collections <a class="headerlink leafygreen-ui-1kepx47" href="#sharded-collections" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sharded-collections"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.delete" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> delete </code> </span> </a> operations for a sharded collection that specify the <code class="leafygreen-ui-1l06pbn"> limit: 1 </code> option: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you only target one shard, you can use a partial shard key in the query specification or, </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can provide the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key"> shard key </a> or the <code class="leafygreen-ui-1l06pbn"> _id </code> field in the query specification. </p> </li> </ul> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Limits <a class="headerlink leafygreen-ui-1kepx47" href="#limits" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="limits"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The total size of all the queries (i.e. the <code class="leafygreen-ui-1l06pbn"> q </code> field values) in the <code class="leafygreen-ui-1l06pbn"> deletes </code> array must be less than or equal to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/limits/#mongodb-limit-BSON-Document-Size"> maximum BSON document size <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The total number of delete documents in the <code class="leafygreen-ui-1l06pbn"> deletes </code> array must be less than or equal to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/limits/#mongodb-limit-Write-Command-Batch-Limit-Size"> maximum bulk size <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Transactions <a class="headerlink leafygreen-ui-1kepx47" href="#transactions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="transactions"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> delete <!-- --> can be used inside <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions"> distributed transactions <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Do not explicitly set the write concern for the operation if run in a transaction. To use write concern with transactions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions-write-concern"> Transactions and Write Concern <!-- --> . </a> </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> In most cases, a distributed transaction incurs a greater performance cost over single document writes, and the availability of distributed transactions should not be a replacement for effective schema design. For many scenarios, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/concepts/embedding-vs-references/#std-label-data-modeling-embedding"> denormalized data model (embedded documents and arrays) </a> will continue to be optimal for your data and use cases. That is, for many scenarios, modeling your data appropriately will minimize the need for distributed transactions. </p> <p class="leafygreen-ui-1kp3ins"> For additional transactions usage considerations (such as runtime limit and oplog size limit), see also <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions-production-consideration/#std-label-production-considerations"> Production Considerations <!-- --> . </a> </p> </div> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Limit the Number of Documents Deleted <a class="headerlink leafygreen-ui-1kepx47" href="#limit-the-number-of-documents-deleted" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="limit-the-number-of-documents-deleted"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example deletes from the <code class="leafygreen-ui-1l06pbn"> orders </code> collection one document that has the <code class="leafygreen-ui-1l06pbn"> status </code> equal to <code class="leafygreen-ui-1l06pbn"> D </code> by specifying the <code class="leafygreen-ui-1l06pbn"> limit </code> of <code class="leafygreen-ui-1l06pbn"> 1 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand(\n {\n delete: \"orders\",\n deletes: [ { q: { status: \"D\" }, limit: 1 } ]\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">delete</span>: <span class="lg-highlight-string">"orders"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">deletes</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">q</span>: <!-- -->{ <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"D"</span> }<!-- -->, <span class="lg-highlight-attr">limit</span>: <span class="lg-highlight-number">1</span> } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The returned document shows that the command deleted <code class="leafygreen-ui-1l06pbn"> 1 </code> document. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-delete-command-output" target="_self"> <span> Output </span> </a> for details. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"ok\" : 1, \"n\" : 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"ok"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.delete" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> delete </code> </span> </a> operations for a sharded collection that specify the <code class="leafygreen-ui-1l06pbn"> limit: 1 </code> option: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you only target one shard, you can use a partial shard key in the query specification or, </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can provide the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key"> shard key </a> or the <code class="leafygreen-ui-1l06pbn"> _id </code> field in the query specification. </p> </li> </ul> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Delete All Documents That Match a Condition <a class="headerlink leafygreen-ui-1kepx47" href="#delete-all-documents-that-match-a-condition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="delete-all-documents-that-match-a-condition"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example deletes from the <code class="leafygreen-ui-1l06pbn"> orders </code> collection all documents that have the <code class="leafygreen-ui-1l06pbn"> status </code> equal to <code class="leafygreen-ui-1l06pbn"> D </code> by specifying the <code class="leafygreen-ui-1l06pbn"> limit </code> of <code class="leafygreen-ui-1l06pbn"> 0 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand(\n {\n delete: \"orders\",\n deletes: [ { q: { status: \"D\" }, limit: 0 } ],\n writeConcern: { w: \"majority\", wtimeout: 5000 }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">delete</span>: <span class="lg-highlight-string">"orders"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">deletes</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">q</span>: <!-- -->{ <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"D"</span> }<!-- -->, <span class="lg-highlight-attr">limit</span>: <span class="lg-highlight-number">0</span> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">writeConcern</span>: <!-- -->{ <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-string">"majority"</span>, <span class="lg-highlight-attr">wtimeout</span>: <span class="lg-highlight-number">5000</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The returned document shows that the command found and deleted <code class="leafygreen-ui-1l06pbn"> 13 </code> documents. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-delete-command-output" target="_self"> <span> Output </span> </a> for details. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"ok\" : 1, \"n\" : 13 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"ok"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-number">13</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Delete All Documents from a Collection <a class="headerlink leafygreen-ui-1kepx47" href="#delete-all-documents-from-a-collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="delete-all-documents-from-a-collection"> </div> </a> </h3> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If you are deleting all documents in a large collection, it may be faster to drop the collection and recreate it. Before dropping the collection, note all indexes on the collection. You must recreate any <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/create-index/#std-label-manual-create-an-index"> indexes </a> that existed in the original collection. If the original collection was sharded, you must also <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-shard-a-collection/#std-label-sharding-shard-key-creation"> shard </a> the recreated collection. </p> <p class="leafygreen-ui-1kp3ins"> For more information on dropping a collection, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.drop/#mongodb-method-db.collection.drop"> <code class="leafygreen-ui-1l06pbn"> db.collection.drop() </code> . </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Delete all documents in the <code class="leafygreen-ui-1l06pbn"> orders </code> collection by specifying an empty query condition <em> and </em> a <code class="leafygreen-ui-1l06pbn"> limit </code> of <code class="leafygreen-ui-1l06pbn"> 0 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand(\n {\n delete: \"orders\",\n deletes: [ { q: { }, limit: 0 } ],\n writeConcern: { w: \"majority\", wtimeout: 5000 }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">delete</span>: <span class="lg-highlight-string">"orders"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">deletes</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">q</span>: <!-- -->{ <!-- -->}<!-- -->, <span class="lg-highlight-attr">limit</span>: <span class="lg-highlight-number">0</span> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">writeConcern</span>: <!-- -->{ <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-string">"majority"</span>, <span class="lg-highlight-attr">wtimeout</span>: <span class="lg-highlight-number">5000</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The returned document shows that the command found and deleted <code class="leafygreen-ui-1l06pbn"> 35 </code> documents in total. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-delete-command-output" target="_self"> <span> Output </span> </a> for details. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"ok\" : 1, \"n\" : 35 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"ok"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-number">35</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Bulk Delete <a class="headerlink leafygreen-ui-1kepx47" href="#bulk-delete" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="bulk-delete"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example performs multiple delete operations on the <code class="leafygreen-ui-1l06pbn"> orders </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand(\n {\n delete: \"orders\",\n deletes: [\n { q: { status: \"D\" }, limit: 0 },\n { q: { cust_num: 99999, item: \"abc123\", status: \"A\" }, limit: 1 }\n ],\n ordered: false,\n writeConcern: { w: 1 }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">delete</span>: <span class="lg-highlight-string">"orders"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">deletes</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">q</span>: <!-- -->{ <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"D"</span> }<!-- -->, <span class="lg-highlight-attr">limit</span>: <span class="lg-highlight-number">0</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">q</span>: <!-- -->{ <span class="lg-highlight-attr">cust_num</span>: <span class="lg-highlight-number">99999</span>, <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">"abc123"</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"A"</span> }<!-- -->, <span class="lg-highlight-attr">limit</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">ordered</span>: <span class="lg-highlight-literal">false</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">writeConcern</span>: <!-- -->{ <span class="lg-highlight-attr">w</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The returned document shows that the command found and deleted <code class="leafygreen-ui-1l06pbn"> 21 </code> documents in total for the two delete statements. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-delete-command-output" target="_self"> <span> Output </span> </a> for details. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"ok\" : 1, \"n\" : 21 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"ok"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-number">21</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify Collation <a class="headerlink leafygreen-ui-1kepx47" href="#specify-collation" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="specify-collation"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> Collation </a> allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks. </p> <p class="leafygreen-ui-1kp3ins"> A collection <code class="leafygreen-ui-1l06pbn"> myColl </code> has the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ _id: 1, category: \"café\", status: \"A\" }\n{ _id: 2, category: \"cafe\", status: \"a\" }\n{ _id: 3, category: \"cafE\", status: \"a\" }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"café"</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"A"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"a"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafE"</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"a"</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation includes the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> collation </a> option: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand({\n delete: \"myColl\",\n deletes: [\n { q: { category: \"cafe\", status: \"a\" }, limit: 0, collation: { locale: \"fr\", strength: 1 } }\n ]\n})","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">delete</span>: <span class="lg-highlight-string">"myColl"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">deletes</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">q</span>: <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span>, <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-string">"a"</span> }<!-- -->, <span class="lg-highlight-attr">limit</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span>, <span class="lg-highlight-attr">strength</span>: <span class="lg-highlight-number">1</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-ex-delete-command-hint"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify <code class="leafygreen-ui-1l06pbn"> hint </code> for Delete Operations <a class="headerlink leafygreen-ui-1kepx47" href="#specify-hint-for-delete-operations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="specify-hint-for-delete-operations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> In <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , create a <code class="leafygreen-ui-1l06pbn"> members </code> collection with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.members.insertMany([\n { \"_id\" : 1, \"member\" : \"abc123\", \"status\" : \"P\", \"points\" : 0, \"misc1\" : null, \"misc2\" : null },\n { \"_id\" : 2, \"member\" : \"xyz123\", \"status\" : \"A\", \"points\" : 60, \"misc1\" : \"reminder: ping me at 100pts\", \"misc2\" : \"Some random comment\" },\n { \"_id\" : 3, \"member\" : \"lmn123\", \"status\" : \"P\", \"points\" : 0, \"misc1\" : null, \"misc2\" : null },\n { \"_id\" : 4, \"member\" : \"pqr123\", \"status\" : \"D\", \"points\" : 20, \"misc1\" : \"Deactivated\", \"misc2\" : null },\n { \"_id\" : 5, \"member\" : \"ijk123\", \"status\" : \"P\", \"points\" : 0, \"misc1\" : null, \"misc2\" : null },\n { \"_id\" : 6, \"member\" : \"cde123\", \"status\" : \"A\", \"points\" : 86, \"misc1\" : \"reminder: ping me at 100pts\", \"misc2\" : \"Some random comment\" }\n])","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">members</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(<!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"member"</span> <!-- -->: <span class="lg-highlight-string">"abc123"</span>, <span class="lg-highlight-string">"status"</span> <!-- -->: <span class="lg-highlight-string">"P"</span>, <span class="lg-highlight-string">"points"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"misc1"</span> <!-- -->: <span class="lg-highlight-literal">null</span>, <span class="lg-highlight-string">"misc2"</span> <!-- -->: <span class="lg-highlight-literal">null</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"member"</span> <!-- -->: <span class="lg-highlight-string">"xyz123"</span>, <span class="lg-highlight-string">"status"</span> <!-- -->: <span class="lg-highlight-string">"A"</span>, <span class="lg-highlight-string">"points"</span> <!-- -->: <span class="lg-highlight-number">60</span>, <span class="lg-highlight-string">"misc1"</span> <!-- -->: <span class="lg-highlight-string">"reminder: ping me at 100pts"</span>, <span class="lg-highlight-string">"misc2"</span> <!-- -->: <span class="lg-highlight-string">"Some random comment"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"member"</span> <!-- -->: <span class="lg-highlight-string">"lmn123"</span>, <span class="lg-highlight-string">"status"</span> <!-- -->: <span class="lg-highlight-string">"P"</span>, <span class="lg-highlight-string">"points"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"misc1"</span> <!-- -->: <span class="lg-highlight-literal">null</span>, <span class="lg-highlight-string">"misc2"</span> <!-- -->: <span class="lg-highlight-literal">null</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"member"</span> <!-- -->: <span class="lg-highlight-string">"pqr123"</span>, <span class="lg-highlight-string">"status"</span> <!-- -->: <span class="lg-highlight-string">"D"</span>, <span class="lg-highlight-string">"points"</span> <!-- -->: <span class="lg-highlight-number">20</span>, <span class="lg-highlight-string">"misc1"</span> <!-- -->: <span class="lg-highlight-string">"Deactivated"</span>, <span class="lg-highlight-string">"misc2"</span> <!-- -->: <span class="lg-highlight-literal">null</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"member"</span> <!-- -->: <span class="lg-highlight-string">"ijk123"</span>, <span class="lg-highlight-string">"status"</span> <!-- -->: <span class="lg-highlight-string">"P"</span>, <span class="lg-highlight-string">"points"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"misc1"</span> <!-- -->: <span class="lg-highlight-literal">null</span>, <span class="lg-highlight-string">"misc2"</span> <!-- -->: <span class="lg-highlight-literal">null</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-string">"member"</span> <!-- -->: <span class="lg-highlight-string">"cde123"</span>, <span class="lg-highlight-string">"status"</span> <!-- -->: <span class="lg-highlight-string">"A"</span>, <span class="lg-highlight-string">"points"</span> <!-- -->: <span class="lg-highlight-number">86</span>, <span class="lg-highlight-string">"misc1"</span> <!-- -->: <span class="lg-highlight-string">"reminder: ping me at 100pts"</span>, <span class="lg-highlight-string">"misc2"</span> <!-- -->: <span class="lg-highlight-string">"Some random comment"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">])</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Create the following indexes on the collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.members.createIndex( { status: 1 } )\ndb.members.createIndex( { points: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">members</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-number">1</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">members</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">points</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following delete operation explicitly hints to use the index <code class="leafygreen-ui-1l06pbn"> { status: 1 } </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand({\n delete: \"members\",\n deletes: [\n { q: { \"points\": { $lte: 20 }, \"status\": \"P\" }, limit: 0, hint: { status: 1 } }\n ]\n})","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(<!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">delete</span>: <span class="lg-highlight-string">"members"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">deletes</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">q</span>: <!-- -->{ <span class="lg-highlight-string">"points"</span>: <!-- -->{ <span class="lg-highlight-attr">$lte</span>: <span class="lg-highlight-number">20</span> }<!-- -->, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"P"</span> }<!-- -->, <span class="lg-highlight-attr">limit</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">hint</span>: <!-- -->{ <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-number">1</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">})</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If you specify an index that does not exist, the operation errors. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> To see the index used, run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/explain/#mongodb-dbcommand-dbcmd.explain"> <code class="leafygreen-ui-1l06pbn"> explain </code> </a> on the operation: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand(\n {\n explain: {\n delete: \"members\",\n deletes: [\n { q: { \"points\": { $lte: 20 }, \"status\": \"P\" }, limit: 0, hint: { status: 1 } }\n ]\n },\n verbosity: \"queryPlanner\"\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">explain</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">delete</span>: <span class="lg-highlight-string">"members"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">deletes</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">q</span>: <!-- -->{ <span class="lg-highlight-string">"points"</span>: <!-- -->{ <span class="lg-highlight-attr">$lte</span>: <span class="lg-highlight-number">20</span> }<!-- -->, <span class="lg-highlight-string">"status"</span>: <span class="lg-highlight-string">"P"</span> }<!-- -->, <span class="lg-highlight-attr">limit</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">hint</span>: <!-- -->{ <span class="lg-highlight-attr">status</span>: <span class="lg-highlight-number">1</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">verbosity</span>: <span class="lg-highlight-string">"queryPlanner"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-delete-let-example"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use Variables in <code class="leafygreen-ui-1l06pbn"> let </code> <a class="headerlink leafygreen-ui-1kepx47" href="#use-variables-in-let" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-variables-in-let"> </div> </a> </h3> <div> <p> <em> New <!-- --> in version <!-- --> 5.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> To define variables that you can access elsewhere in the command, use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-delete-let-syntax" target="_self"> <span> let </span> </a> option. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To filter results using a variable, you must access the variable within the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/expr/#mongodb-query-op.-expr"> <code class="leafygreen-ui-1l06pbn"> $expr </code> </a> operator. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Create a collection <code class="leafygreen-ui-1l06pbn"> cakeFlavors </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeFlavors.insertMany( [\n { _id: 1, flavor: \"chocolate\" },\n { _id: 2, flavor: \"strawberry\" },\n { _id: 3, flavor: \"cherry\" }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeFlavors</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">flavor</span>: <span class="lg-highlight-string">"chocolate"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">flavor</span>: <span class="lg-highlight-string">"strawberry"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">flavor</span>: <span class="lg-highlight-string">"cherry"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example defines a <code class="leafygreen-ui-1l06pbn"> targetFlavor </code> variable in <code class="leafygreen-ui-1l06pbn"> let </code> and uses the variable to delete the strawberry cake flavor: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand( {\n delete: db.cakeFlavors.getName(),\n deletes: [ {\n q: { $expr: { $eq: [ \"$flavor\", \"$$targetFlavor\" ] } },\n limit: 1\n } ],\n let : { targetFlavor: \"strawberry\" }\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">delete</span>: <!-- -->db.<span class="lg-highlight-property">cakeFlavors</span>.<span class="lg-highlight-title lg-highlight-function">getName</span>(<!-- -->)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">deletes</span>: <!-- -->[ <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">q</span>: <!-- -->{ <span class="lg-highlight-attr">$expr</span>: <!-- -->{ <span class="lg-highlight-attr">$eq</span>: <!-- -->[ <span class="lg-highlight-string">"$flavor"</span>, <span class="lg-highlight-string">"$$targetFlavor"</span> ] } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">limit</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">let</span> <!-- -->: <!-- -->{ <span class="lg-highlight-attr">targetFlavor</span>: <span class="lg-highlight-string">"strawberry"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-delete-command-output"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Output <a class="headerlink leafygreen-ui-1kepx47" href="#output" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="output"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The returned document contains a subset of the following fields: </p> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> delete.ok </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-delete.ok" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-delete.ok"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The status of the command. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> delete.n </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-delete.n" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-delete.n"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The number of documents deleted. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> delete.writeErrors </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-delete.writeErrors" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-delete.writeErrors"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> An array of documents that contains information regarding any error encountered during the delete operation. The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-data-delete.writeErrors" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> writeErrors </code> </span> </a> array contains an error document for each delete statement that errors. </p> <p class="leafygreen-ui-1kp3ins"> Each error document contains the following information: </p> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> delete.writeErrors.index </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-delete.writeErrors.index" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-delete.writeErrors.index"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> An integer that identifies the delete statement in the <code class="leafygreen-ui-1l06pbn"> deletes </code> array, which uses a zero-based index. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> delete.writeErrors.code </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-delete.writeErrors.code" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-delete.writeErrors.code"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> An integer value identifying the error. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> delete.writeErrors.errmsg </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-delete.writeErrors.errmsg" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-delete.writeErrors.errmsg"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A description of the error. </p> </dd> </dl> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> delete.writeConcernError </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-delete.writeConcernError" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-delete.writeConcernError"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Document describing errors that relate to the write concern. </p> <div> <p> <em> Changed <!-- --> in version <!-- --> 7.1 </em> : <!-- --> When <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/delete/#mongodb-dbcommand-dbcmd.delete"> <code class="leafygreen-ui-1l06pbn"> delete </code> </a> executes on <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#std-program-mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , write concern errors are always reported, even when one or more write errors occur. </p> <p class="leafygreen-ui-1kp3ins"> In previous releases, the occurrence of write errors could cause the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.delete" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> delete </code> </span> </a> to not report write concern errors. </p> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> writeConcernError </code> documents contian the following fields: </p> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> delete.writeConcernError.code </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-delete.writeConcernError.code" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-delete.writeConcernError.code"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> An integer value identifying the cause of the write concern error. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> delete.writeConcernError.errmsg </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-delete.writeConcernError.errmsg" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-delete.writeConcernError.errmsg"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A description of the cause of the write concern error. </p> </dd> </dl> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> delete.writeConcernError.errInfo.writeConcern </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-delete.writeConcernError.errInfo.writeConcern" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-delete.writeConcernError.errInfo.writeConcern"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The write concern object used for the corresponding operation. For information on write concern object fields, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-specs"> Write Concern Specification <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The write concern object may also contain the following field, indicating the source of the write concern: </p> <dl class="data"> <dt> <code class="leafygreen-ui-1l06pbn"> delete.writeConcernError.errInfo.writeConcern.provenance </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-data-delete.writeConcernError.errInfo.writeConcern.provenance" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-data-delete.writeConcernError.errInfo.writeConcern.provenance"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> A string value indicating where the write concern originated (known as write concern <code class="leafygreen-ui-1l06pbn"> provenance </code> ). The following table shows the possible values for this field and their significance: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:40%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Provenance </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> clientSupplied </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The write concern was specified in the application. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> customDefault </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The write concern originated from a custom defined default value. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setDefaultRWConcern/#mongodb-dbcommand-dbcmd.setDefaultRWConcern"> <code class="leafygreen-ui-1l06pbn"> setDefaultRWConcern </code> . </a> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> getLastErrorDefaults </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The write concern originated from the replica set's <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.settings.getLastErrorDefaults"> <code class="leafygreen-ui-1l06pbn"> settings.getLastErrorDefaults </code> </a> field. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> implicitDefault </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The write concern originated from the server in absence of all other write concern specifications. </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> </dd> </dl> </dd> </dl> <p class="leafygreen-ui-1kp3ins"> The following is an example document returned for a successful <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.delete" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> delete </code> </span> </a> command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ ok: 1, n: 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">ok</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following is an example document returned for a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.delete" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> delete </code> </span> </a> command that encountered an error because it specified a non-existent index in the <code class="leafygreen-ui-1l06pbn"> hint </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n n: 0,\n writeErrors: [\n {\n index: 0,\n code: 2,\n errmsg: 'error processing query: ns=test.products: hat $eq \"bowler\"\\n' +\n 'Sort: {}\\n' +\n 'Proj: {}\\n' +\n ' planner returned error :: caused by :: hint provided does not correspond to an existing index'\n }\n ],\n ok: 1\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">writeErrors</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">index</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">code</span>: <span class="lg-highlight-number">2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">errmsg</span>: <span class="lg-highlight-string">'error processing query: ns=test.products: hat $eq "bowler"</span><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">'</span> <!-- -->+</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'Sort: {}</span><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">'</span> <!-- -->+</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">'Proj: {}</span><span class="lg-highlight-string">\n</span><span class="lg-highlight-string">'</span> <!-- -->+</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">' planner returned error :: caused by :: hint provided does not correspond to an existing index'</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">ok</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/update/sort/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $sort <a class="headerlink leafygreen-ui-1kepx47" href="#-sort" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-sort"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <dl class="update"> <dt> <code class="leafygreen-ui-1l06pbn"> $sort </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-update-up.-sort" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-update-up.-sort"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sort </code> </span> </a> modifier orders the elements of an array during a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#mongodb-update-up.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> operation. </p> <p class="leafygreen-ui-1kp3ins"> To use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sort </code> </span> </a> modifier, it <strong> must </strong> appear with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/each/#mongodb-update-up.-each"> <code class="leafygreen-ui-1l06pbn"> $each </code> </a> modifier. You can pass an empty array <code class="leafygreen-ui-1l06pbn"> [] </code> to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/each/#mongodb-update-up.-each"> <code class="leafygreen-ui-1l06pbn"> $each </code> </a> modifier such that only the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sort </code> </span> </a> modifier has an effect. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n $push: {\n &lt;field&gt;: {\n $each: [ &lt;value1&gt;, &lt;value2&gt;, ... ],\n $sort: &lt;sort&gt;\n }\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$push</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;<!-- -->field<!-- -->&gt;<!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$each</span>: <!-- -->[ &lt;<!-- -->value1<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->value2<!-- -->&gt;<!-- -->,<!-- --> <!-- -->...<!-- --> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$sort</span>: <span class="lg-highlight-tag lg-highlight-xml">&lt;</span><span class="lg-highlight-name lg-highlight-tag lg-highlight-xml">sort</span><span class="lg-highlight-tag lg-highlight-xml"> </span><span class="lg-highlight-attr lg-highlight-tag lg-highlight-xml">specification</span><span class="lg-highlight-tag lg-highlight-xml">&gt;</span><span class="lg-highlight-xml"></span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-xml"> }</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-xml"> }</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-xml">}</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For <code class="leafygreen-ui-1l06pbn"> &lt;sort specification&gt; </code> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To sort array elements that are not documents, or if the array elements are documents, to sort by the whole documents, specify <code class="leafygreen-ui-1l06pbn"> 1 </code> for ascending or <code class="leafygreen-ui-1l06pbn"> -1 </code> for descending. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the array elements are documents, to sort by a field in the documents, specify a sort document with the field and the direction, i.e. <code class="leafygreen-ui-1l06pbn"> { field: 1 } </code> or <code class="leafygreen-ui-1l06pbn"> { field: -1 } </code> . Do <strong> not </strong> reference the containing array field in the sort specification (e.g. <code class="leafygreen-ui-1l06pbn"> { "arrayField.field": 1 } </code> is incorrect). </p> </li> </ul> </dd> </dl> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, update operators process document fields with string-based names in lexicographic order. Fields with numeric names are processed in numeric order. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-processing-order"> Update Operators Behavior </a> for details. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sort </code> </span> </a> modifier can sort array elements that are not documents. In previous versions, the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sort </code> </span> </a> modifier required the array elements be documents. </p> <p class="leafygreen-ui-1kp3ins"> If the array elements are documents, the modifier can sort by either the whole document or by a specific field in the documents. In previous versions, the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sort </code> </span> </a> modifier can only sort by a specific field in the documents. </p> <p class="leafygreen-ui-1kp3ins"> Trying to use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sort </code> </span> </a> modifier without the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/each/#mongodb-update-up.-each"> <code class="leafygreen-ui-1l06pbn"> $each </code> </a> modifier results in an error. The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sort </code> </span> </a> no longer requires the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/slice/#mongodb-update-up.-slice"> <code class="leafygreen-ui-1l06pbn"> $slice </code> </a> modifier. For a list of modifiers available for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#mongodb-update-up.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#std-label-push-modifiers"> Modifiers <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <span class="leafygreen-ui-1qnjd6d" id="std-label-example-sort-by-field-in-documents"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sort Array of Documents by a Field in the Documents <a class="headerlink leafygreen-ui-1kepx47" href="#sort-array-of-documents-by-a-field-in-the-documents" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sort-array-of-documents-by-a-field-in-the-documents"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Create the <code class="leafygreen-ui-1l06pbn"> students </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.insertOne(\n {\n \"_id\": 1,\n \"quizzes\": [\n { \"id\" : 1, \"score\" : 6 },\n { \"id\" : 2, \"score\" : 9 }\n ]\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"quizzes"</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">6</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">9</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following update appends additional documents to the <code class="leafygreen-ui-1l06pbn"> quizzes </code> array and then sorts all the elements of the array by the ascending <code class="leafygreen-ui-1l06pbn"> score </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.updateOne(\n { _id: 1 },\n {\n $push: {\n quizzes: {\n $each: [ { id: 3, score: 8 }, { id: 4, score: 7 }, { id: 5, score: 6 } ],\n $sort: { score: 1 }\n }\n }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$push</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quizzes</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$each</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">8</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">7</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">id</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">6</span> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$sort</span>: <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The sort document refers directly to the field in the documents and does not reference the containing array field <code class="leafygreen-ui-1l06pbn"> quizzes </code> ; i.e. <code class="leafygreen-ui-1l06pbn"> { score: 1 } </code> and <strong> not </strong> <code class="leafygreen-ui-1l06pbn"> { "quizzes.score": 1} </code> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> After the update, the array elements are in order of ascending <code class="leafygreen-ui-1l06pbn"> score </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : 1,\n \"quizzes\" : [\n { \"id\" : 1, \"score\" : 6 },\n { \"id\" : 5, \"score\" : 6 },\n { \"id\" : 4, \"score\" : 7 },\n { \"id\" : 3, \"score\" : 8 },\n { \"id\" : 2, \"score\" : 9 }\n ]\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"quizzes"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">6</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">6</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">7</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">8</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">9</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Sort Array Elements That Are Not Documents <a class="headerlink leafygreen-ui-1kepx47" href="#sort-array-elements-that-are-not-documents" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sort-array-elements-that-are-not-documents"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Add the following document to the <code class="leafygreen-ui-1l06pbn"> students </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.insertOne( { \"_id\" : 2, \"tests\" : [ 89, 70, 89, 50 ] } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>( <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"tests"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">89</span>, <span class="lg-highlight-number">70</span>, <span class="lg-highlight-number">89</span>, <span class="lg-highlight-number">50</span> ] } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation adds two more elements to the <code class="leafygreen-ui-1l06pbn"> tests </code> array and sorts the elements: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.updateOne(\n { _id: 2 },\n { $push: { tests: { $each: [ 40, 60 ], $sort: 1 } } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$push</span>: <!-- -->{ <span class="lg-highlight-attr">tests</span>: <!-- -->{ <span class="lg-highlight-attr">$each</span>: <!-- -->[ <span class="lg-highlight-number">40</span>, <span class="lg-highlight-number">60</span> ]<!-- -->, <span class="lg-highlight-attr">$sort</span>: <span class="lg-highlight-number">1</span> } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The updated document has the elements of the <code class="leafygreen-ui-1l06pbn"> tests </code> array in ascending order: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 2, \"tests\" : [ 40, 50, 60, 70, 89, 89 ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"tests"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">40</span>, <span class="lg-highlight-number">50</span>, <span class="lg-highlight-number">60</span>, <span class="lg-highlight-number">70</span>, <span class="lg-highlight-number">89</span>, <span class="lg-highlight-number">89</span> ] }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Update Array Using Sort Only <a class="headerlink leafygreen-ui-1kepx47" href="#update-array-using-sort-only" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="update-array-using-sort-only"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Add the following document to the <code class="leafygreen-ui-1l06pbn"> students </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.insertOne( { \"_id\" : 3, \"tests\" : [ 89, 70, 100, 20 ] } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>( <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"tests"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">89</span>, <span class="lg-highlight-number">70</span>, <span class="lg-highlight-number">100</span>, <span class="lg-highlight-number">20</span> ] } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To update the <code class="leafygreen-ui-1l06pbn"> tests </code> field to sort its elements in descending order, specify the <code class="leafygreen-ui-1l06pbn"> { $sort: -1 } </code> and specify an empty array <code class="leafygreen-ui-1l06pbn"> [] </code> for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/each/#mongodb-update-up.-each"> <code class="leafygreen-ui-1l06pbn"> $each </code> </a> modifier. For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.updateOne(\n { _id: 3 },\n { $push: { tests: { $each: [ ], $sort: -1 } } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$push</span>: <!-- -->{ <span class="lg-highlight-attr">tests</span>: <!-- -->{ <span class="lg-highlight-attr">$each</span>: <!-- -->[ <!-- -->]<!-- -->, <span class="lg-highlight-attr">$sort</span>: <!-- -->-<span class="lg-highlight-number">1</span> } } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The example sorts the <code class="leafygreen-ui-1l06pbn"> tests </code> field values in descending order: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 3, \"tests\" : [ 100, 89, 70, 20 ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"tests"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">100</span>, <span class="lg-highlight-number">89</span>, <span class="lg-highlight-number">70</span>, <span class="lg-highlight-number">20</span> ] }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use <code class="leafygreen-ui-1l06pbn"> $sort </code> with Other <code class="leafygreen-ui-1l06pbn"> $push </code> Modifiers <a class="headerlink leafygreen-ui-1kepx47" href="#use--sort-with-other--push-modifiers" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use--sort-with-other--push-modifiers"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Add the following document to the <code class="leafygreen-ui-1l06pbn"> students </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.insertOne(\n {\n \"_id\" : 5,\n \"quizzes\" : [\n { \"wk\": 1, \"score\" : 10 },\n { \"wk\": 2, \"score\" : 8 },\n { \"wk\": 3, \"score\" : 5 },\n { \"wk\": 4, \"score\" : 6 }\n ]\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"quizzes"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"wk"</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">10</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"wk"</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">8</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"wk"</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">5</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"wk"</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">6</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#mongodb-update-up.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> operation uses: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/each/#mongodb-update-up.-each"> <code class="leafygreen-ui-1l06pbn"> $each </code> </a> modifier to add multiple documents to the <code class="leafygreen-ui-1l06pbn"> quizzes </code> array, </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-sort" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $sort </code> </span> </a> modifier to sort all the elements of the modified <code class="leafygreen-ui-1l06pbn"> quizzes </code> array by the <code class="leafygreen-ui-1l06pbn"> score </code> field in descending order, and </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/slice/#mongodb-update-up.-slice"> <code class="leafygreen-ui-1l06pbn"> $slice </code> </a> modifier to keep only the <strong> first </strong> three sorted elements of the <code class="leafygreen-ui-1l06pbn"> quizzes </code> array. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.updateOne(\n { _id: 5 },\n {\n $push: {\n quizzes: {\n $each: [ { wk: 5, score: 8 }, { wk: 6, score: 7 }, { wk: 7, score: 6 } ],\n $sort: { score: -1 },\n $slice: 3\n }\n }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">5</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$push</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quizzes</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$each</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">wk</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">8</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">wk</span>: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">7</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">wk</span>: <span class="lg-highlight-number">7</span>, <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">6</span> } ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$sort</span>: <!-- -->{ <span class="lg-highlight-attr">score</span>: <!-- -->-<span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$slice</span>: <span class="lg-highlight-number">3</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> After the operation only the three highest scoring quizzes are in the array: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : 5,\n \"quizzes\" : [\n { \"wk\" : 1, \"score\" : 10 },\n { \"wk\" : 2, \"score\" : 8 },\n { \"wk\" : 5, \"score\" : 8 }\n ]\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"quizzes"</span> <!-- -->: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"wk"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">10</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"wk"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">8</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"wk"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"score"</span> <!-- -->: <span class="lg-highlight-number">8</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The order of the modifiers in the query does not change the order that the modifiers are applied. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#std-label-push-modifiers"> Modifiers <!-- --> . </a> </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/core/indexes/index-types/index-single/create-single-field-index/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Create an Index on a Single Field <a class="headerlink leafygreen-ui-1kepx47" href="#create-an-index-on-a-single-field" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-an-index-on-a-single-field"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#before-you-begin" target="_self"> <span> Before You Begin </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#procedures" target="_self"> <span> Procedures </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#create-an-index-on-a-single-field-1" target="_self"> <span> Create an Index on a Single Field </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#create-an-index-on-an-embedded-field" target="_self"> <span> Create an Index on an Embedded Field </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self"> <span> Learn More </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> You can create an index on a single field to improve performance for queries on that field. Indexing commonly queried fields increases the chances of <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-optimization/#std-label-indexes-covered-queries"> covering </a> those queries, meaning MongoDB can satisfy the query entirely with the index, without examining documents. </p> <p class="leafygreen-ui-1kp3ins"> To create a single-field index, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndex() </code> </a> method: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.&lt;collection&gt;.createIndex( { &lt;field&gt;: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<!-- -->&lt;<!-- -->collection<!-- -->&gt;<!-- -->.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ &lt;<!-- -->field<!-- -->&gt;<!-- -->: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Index Sort Order </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Using a descending single-field index may negatively impact index performance. For best performance, only use ascending single-field indexes. </p> </div> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Before You Begin <a class="headerlink leafygreen-ui-1kepx47" href="#before-you-begin" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="before-you-begin"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Create a <code class="leafygreen-ui-1l06pbn"> students </code> collection that contains the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.insertMany( [\n {\n \"name\": \"Alice\",\n \"gpa\": 3.6,\n \"location\": { city: \"Sacramento\", state: \"California\" }\n },\n {\n \"name\": \"Bob\",\n \"gpa\": 3.2,\n \"location\": { city: \"Albany\", state: \"New York\" }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"name"</span>: <span class="lg-highlight-string">"Alice"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"gpa"</span>: <span class="lg-highlight-number">3.6</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"location"</span>: <!-- -->{ <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-string">"Sacramento"</span>, <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"California"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"name"</span>: <span class="lg-highlight-string">"Bob"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"gpa"</span>: <span class="lg-highlight-number">3.2</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"location"</span>: <!-- -->{ <span class="lg-highlight-attr">city</span>: <span class="lg-highlight-string">"Albany"</span>, <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"New York"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedures <a class="headerlink leafygreen-ui-1kepx47" href="#procedures" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="procedures"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following examples show you how to: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-index-create-ascending-single-field" target="_self"> <span> Create an Index on a Single Field </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-index-embedded-fields" target="_self"> <span> Create an Index on an Embedded Field </span> </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-index-create-ascending-single-field"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create an Index on a Single Field <a class="headerlink leafygreen-ui-1kepx47" href="#create-an-index-on-a-single-field-1" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-an-index-on-a-single-field-1"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Consider a school administrator who frequently looks up students by their <span class="leafygreen-ui-vm4wms" tabindex="0"> GPA </span> . You can create an index on the <code class="leafygreen-ui-1l06pbn"> gpa </code> field to improve performance for those queries: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.createIndex( { gpa: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">gpa</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Results <a class="headerlink leafygreen-ui-1kepx47" href="#results" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="results"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> The index supports queries that select on the field <code class="leafygreen-ui-1l06pbn"> gpa </code> , such as the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.find( { gpa: 3.6 } )\n\ndb.students.find( { gpa: { $lt: 3.4 } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">gpa</span>: <span class="lg-highlight-number">3.6</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">gpa</span>: <!-- -->{ <span class="lg-highlight-attr">$lt</span>: <span class="lg-highlight-number">3.4</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-index-embedded-fields"> </span> </section> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create an Index on an Embedded Field <a class="headerlink leafygreen-ui-1kepx47" href="#create-an-index-on-an-embedded-field" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-an-index-on-an-embedded-field"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can create indexes on fields within embedded documents. Indexes on embedded fields can fulfill queries that use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-dot-notation"> dot notation <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> location </code> field is an embedded document that contains the embedded fields <code class="leafygreen-ui-1l06pbn"> city </code> and <code class="leafygreen-ui-1l06pbn"> state </code> . Create an index on the <code class="leafygreen-ui-1l06pbn"> location.state </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.createIndex( { \"location.state\": 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-string">"location.state"</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Results <a class="headerlink leafygreen-ui-1kepx47" href="#results-1" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="results-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> The index supports queries on the field <code class="leafygreen-ui-1l06pbn"> location.state </code> , such as the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.find( { \"location.state\": \"California\" } )\n\ndb.students.find( { \"location.city\": \"Albany\", \"location.state\": \"New York\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-string">"location.state"</span>: <span class="lg-highlight-string">"California"</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-string">"location.city"</span>: <span class="lg-highlight-string">"Albany"</span>, <span class="lg-highlight-string">"location.state"</span>: <span class="lg-highlight-string">"New York"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-single/create-embedded-object-index/#std-label-index-embedded-documents"> Create an Index on an Embedded Document </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-multikey/create-multikey-index-embedded/#std-label-index-create-multikey-embedded"> Create an Index on an Embedded Field in an Array </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/measure-index-use/#std-label-index-measure-index-use"> Check if a query uses an index </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/#std-label-index-types"> Learn about other types of index types </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/administration/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Administration <a class="headerlink leafygreen-ui-1kepx47" href="#administration" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="administration"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> The administration documentation addresses the ongoing operation and maintenance of MongoDB instances and deployments. This documentation includes both high level overviews of these concerns as well as tutorials that cover specific procedures and processes for operating MongoDB. </p> </section>
https://www.mongodb.com/docs/manual/query-api/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> MongoDB <!-- --> Query API <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-query-api" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-query-api"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#document-model" target="_self"> <span> Document Model </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#data-as-code" target="_self"> <span> Data as Code </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#getting-started" target="_self"> <span> Getting Started </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> The MongoDB <!-- --> Query API <!-- --> is the mechanism that you use to interact with your data. </p> <p class="leafygreen-ui-1kp3ins"> The <!-- --> Query API <!-- --> comprises two ways to query data in MongoDB: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/crud/#std-label-crud"> CRUD Operations </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/aggregation-pipeline/#std-label-aggregation-pipeline"> Aggregation pipelines </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> You can use the <!-- --> Query API <!-- --> to perform: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> Adhoc queries </strong> . Explore your MongoDB data with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/compass/current/" target="_self"> <span> Compass </span> </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://code.visualstudio.com/docs/azure/mongodb" rel="noopener noreferrer"> <span> VSCode </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> or a MongoDB <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> driver <!-- --> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> Data transformations </strong> . Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/aggregation-pipeline/#std-label-aggregation-pipeline"> aggregation pipelines </a> to reshape your data and perform calculations. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> Document join support </strong> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/lookup/#mongodb-pipeline-pipe.-lookup"> <code class="leafygreen-ui-1l06pbn"> $lookup </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/unionWith/#mongodb-pipeline-pipe.-unionWith"> <code class="leafygreen-ui-1l06pbn"> $unionWith </code> </a> to combine data from different collections. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> Graph and geospatial queries </strong> . Use operators such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/geoWithin/#mongodb-query-op.-geoWithin"> <code class="leafygreen-ui-1l06pbn"> $geoWithin </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/geoNear/#mongodb-pipeline-pipe.-geoNear"> <code class="leafygreen-ui-1l06pbn"> $geoNear </code> </a> to analyze geospatial data and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/graphLookup/#mongodb-pipeline-pipe.-graphLookup"> <code class="leafygreen-ui-1l06pbn"> $graphLookup </code> </a> for graph data. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> Full-text search </strong> . Use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/aggregation-stages/search/#mongodb-pipeline-pipe.-search" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $search </code> </span> </a> stage to perform efficient text search on your data. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> Semantic search </strong> . Use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/#mongodb-pipeline-pipe.-vectorSearch" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $vectorSearch </code> </span> </a> stage to perform semantic search on your data. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> Indexing </strong> . Improve your MongoDB query performance by using the correct <a class="leafygreen-ui-tqgtui" href="/docs/manual/indexes/#std-label-indexes"> index type </a> for your data architecture. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> On-demand materialized views </strong> . Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/out/#mongodb-pipeline-pipe.-out"> <code class="leafygreen-ui-1l06pbn"> $out </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/merge/#mongodb-pipeline-pipe.-merge"> <code class="leafygreen-ui-1l06pbn"> $merge </code> </a> to <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/materialized-views/"> create materialized views </a> on common queries. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <strong> Time series analysis </strong> . Query and aggregate your time-stamped data with <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-procedures/#std-label-manual-timeseries-collection-create"> time series collections <!-- --> . </a> </p> </li> </ul> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Document Model <a class="headerlink leafygreen-ui-1kepx47" href="#document-model" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="document-model"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A document in MongoDB is a data structure composed of field and value pairs. Documents are stored as BSON which is the binary representation of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-JSON"> JSON </a> . This low level of abstraction helps you develop quicker and reduces the efforts around querying and data modeling. The document model provides several advantages, including: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Documents correspond to native data types in many programming languages. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Embedded documents and arrays reduce need for expensive joins. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Flexible schema. Documents do not need to have the same set of fields and the data type for a field can differ across documents within a collection. </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Data as Code <a class="headerlink leafygreen-ui-1kepx47" href="#data-as-code" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="data-as-code"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The MongoDB <!-- --> Query API <!-- --> supports <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> drivers </span> </a> for major programming languages. These drivers allow you to make calls to the database and generate queries using the syntax native to your application. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Getting Started <a class="headerlink leafygreen-ui-1kepx47" href="#getting-started" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="getting-started"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To get started, visit the MongoDB <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/getting-started/#std-label-getting-started"> Getting Started Guide </a> . Here you can find resources, code examples and tutorials that demonstrate the MongoDB <!-- --> Query API <!-- --> . </p> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/model-tree-structures-with-parent-references/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Model Tree Structures with Parent References <a class="headerlink leafygreen-ui-1kepx47" href="#model-tree-structures-with-parent-references" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="model-tree-structures-with-parent-references"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#overview" target="_self"> <span> Overview </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#pattern" target="_self"> <span> Pattern </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Overview <a class="headerlink leafygreen-ui-1kepx47" href="#overview" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="overview"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This page describes a data model that describes a tree-like structure in MongoDB documents by storing <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/concepts/embedding-vs-references/#std-label-data-modeling-referencing"> references </a> to "parent" nodes in children nodes. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Pattern <a class="headerlink leafygreen-ui-1kepx47" href="#pattern" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="pattern"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <em> Parent References </em> pattern stores each tree node in a document; in addition to the tree node, the document stores the ID of the node's parent. </p> <p class="leafygreen-ui-1kp3ins"> Consider the following hierarchy of categories: </p> <div class="figure css-5vkxs0" style="width:760px"> <img alt="Tree data model for a sample hierarchy of categories." class="leafygreen-ui-1qnf57e" height="400" src="/docs/manual/images/data-model-tree.bakedsvg.svg" style="--border-color:#C1C7C6" width="540"/> </div> <p class="leafygreen-ui-1kp3ins"> The following example models the tree using <em> Parent References </em> , storing the reference to the parent category in the field <code class="leafygreen-ui-1l06pbn"> parent </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.categories.insertMany( [\n { _id: \"MongoDB\", parent: \"Databases\" },\n { _id: \"dbm\", parent: \"Databases\" },\n { _id: \"Databases\", parent: \"Programming\" },\n { _id: \"Languages\", parent: \"Programming\" },\n { _id: \"Programming\", parent: \"Books\" },\n { _id: \"Books\", parent: null }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">categories</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"MongoDB"</span>, <span class="lg-highlight-attr">parent</span>: <span class="lg-highlight-string">"Databases"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"dbm"</span>, <span class="lg-highlight-attr">parent</span>: <span class="lg-highlight-string">"Databases"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"Databases"</span>, <span class="lg-highlight-attr">parent</span>: <span class="lg-highlight-string">"Programming"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"Languages"</span>, <span class="lg-highlight-attr">parent</span>: <span class="lg-highlight-string">"Programming"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"Programming"</span>, <span class="lg-highlight-attr">parent</span>: <span class="lg-highlight-string">"Books"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"Books"</span>, <span class="lg-highlight-attr">parent</span>: <span class="lg-highlight-literal">null</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The query to retrieve the parent of a node is fast and straightforward: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.categories.findOne( { _id: \"MongoDB\" } ).parent","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">categories</span>.<span class="lg-highlight-title lg-highlight-function">findOne</span>( <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"MongoDB"</span> } ).<span class="lg-highlight-property">parent</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can create an index on the field <code class="leafygreen-ui-1l06pbn"> parent </code> to enable fast search by the parent node: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.categories.createIndex( { parent: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">categories</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">parent</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can query by the <code class="leafygreen-ui-1l06pbn"> parent </code> field to find its immediate children nodes: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.categories.find( { parent: \"Databases\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">categories</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">parent</span>: <span class="lg-highlight-string">"Databases"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To retrieve subtrees, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/graphLookup/#mongodb-pipeline-pipe.-graphLookup"> <code class="leafygreen-ui-1l06pbn"> $graphLookup </code> . </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/cursor.batchSize/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> cursor.batchSize() <a class="headerlink leafygreen-ui-1kepx47" href="#cursor.batchsize--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="cursor.batchsize--"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self"> <span> Learn More </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> cursor.batchSize(size) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-cursor.batchSize" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-cursor.batchSize"> </div> </a> </dt> <dd> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> mongosh Method </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page documents a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> method. This is <em> not </em> the documentation for a language-specific driver, such as Node.js. </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB API drivers, refer to the language-specific <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB driver documentation <!-- --> . </span> </a> </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Specifies the number of documents to return in each batch of the response from the MongoDB instance. In most cases, modifying the batch size will not affect the user or the application, as <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> and most <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> drivers </span> </a> return results as if MongoDB returned a single batch. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If the batch size is too large, the cursor allocates more resources than it requires, which can negatively impact query performance. If the batch size is too small, the cursor requires more network round trips to retrieve the query results, which can negatively impact query performance. </p> <p class="leafygreen-ui-1kp3ins"> Adjust <code class="leafygreen-ui-1l06pbn"> batchSize </code> to a value appropriate to your database, load, and application needs. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-cursor.batchSize" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> batchSize() </code> </span> </a> method takes the following field: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> size </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The initial number of documents to return for a batch. The default initial batch size is 101 documents. Subsequent batches are 16 megabytes. The default applies to drivers and Mongo Shell. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/iterate-a-cursor/#std-label-cursor-batches"> Cursor Batches <!-- --> . </a> </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example sets <code class="leafygreen-ui-1l06pbn"> batchSize </code> for the results of a query (specifically, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find() </code> </a> ) to <code class="leafygreen-ui-1l06pbn"> 10 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find().batchSize(10)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">batchSize</span>(<span class="lg-highlight-number">10</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/iterate-a-cursor/#std-label-cursor-batches"> Cursor Batches </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.next/#mongodb-method-cursor.next"> <code class="leafygreen-ui-1l06pbn"> cursor.next() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getMore/#mongodb-dbcommand-dbcmd.getMore"> <code class="leafygreen-ui-1l06pbn"> getMore </code> </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/administration/backup-sharded-clusters/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Backup and Restore a Self-Managed Sharded Cluster <a class="headerlink leafygreen-ui-1kepx47" href="#backup-and-restore-a-self-managed-sharded-cluster" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="backup-and-restore-a-self-managed-sharded-cluster"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> The following tutorials describe backup and restoration for sharded clusters: </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongodump/#std-program-mongodump" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongodump </code> </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongorestore/#std-program-mongorestore" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongorestore </code> </span> </a> as a backup strategy for sharded clusters, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/backup-sharded-cluster-with-database-dumps/#std-label-backup-sharded-dumps"> Back Up a Self-Managed Sharded Cluster with a Database Dump <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Sharded clusters can also use one of the following coordinated backup and restore processes, which maintain the atomicity guarantees of transactions across shards: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/atlas/database?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/cloud/cloud-manager?tck=docs_server" target="_self"> <span> MongoDB Cloud Manager </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/products/ops-manager?tck=docs_server" target="_self"> <span> MongoDB Ops Manager </span> </a> </p> </li> </ul> </div> </div> <dl> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/backup-sharded-cluster-with-filesystem-snapshots/"> Back Up a Self-Managed Sharded Cluster with File System Snapshots </a> </dt> <dd class="css-1ufxuu7"> Use file system snapshots back up each component in the sharded cluster individually. The procedure involves stopping the cluster balancer. If your system configuration allows file system backups, this might be more efficient than using MongoDB tools. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/backup-sharded-cluster-with-database-dumps/"> Back Up a Self-Managed Sharded Cluster with a Database Dump </a> </dt> <dd class="css-1ufxuu7"> Create backups using <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongodump/#mongodb-binary-bin.mongodump" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongodump </code> </span> </a> to back up each component in the cluster individually. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/schedule-backup-window-for-sharded-clusters/"> Schedule Backup Window for a Self-Managed Sharded Cluster </a> </dt> <dd class="css-1ufxuu7"> Limit the operation of the cluster balancer to provide a window for regular backup operations. </dd> <dt> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/restore-sharded-cluster/"> Restore a Self-Managed Sharded Cluster </a> </dt> <dd class="css-1ufxuu7"> An outline of the procedure and consideration for restoring an <em> entire </em> sharded cluster from backup. </dd> </dl> </section>
https://www.mongodb.com/docs/manual/tutorial/recover-data-following-unexpected-shutdown/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Recover a Self-Managed Standalone after an Unexpected Shutdown <a class="headerlink leafygreen-ui-1kepx47" href="#recover-a-self-managed-standalone-after-an-unexpected-shutdown" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="recover-a-self-managed-standalone-after-an-unexpected-shutdown"> </div> </a> </h1> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The following procedure applies to standalone <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance version 8.0. For other MongoDB versions, refer to the corresponding version of the manual. </p> <p class="leafygreen-ui-1kp3ins"> Do not use this tutorial to recover a member of a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> . Instead, you should either restore from a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/backups/"> backup </a> or resync from another member of the set, as described in <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/resync-replica-set-member/"> Resync a Member of a Self-Managed Replica Set <!-- --> . </a> </p> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If you are running with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-journal"> journaling </a> enabled, there is almost never any need to run repair since the server can use the journal files to restore the data files to a clean state automatically. However, you may need to run repair in cases where you need to recover from a disk-level data corruption. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Disk-level data corruption or missing data files can prevent <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance from starting, and journal files may be insufficient to recover automatically: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"2018-10-24T18:05:18.248-04:00 W STORAGE [initandlisten] Detected unclean shutdown - mongod.lock is not empty.\n\n...\n\n2018-10-24T17:24:53.122-04:00 E STORAGE [initandlisten] Failed to get the cursor for uri: table:collection-2-6854866147293273505\n2018-10-24T17:24:53.122-04:00 E STORAGE [initandlisten] This may be due to missing data files. ...\n\n...\n\n***aborting after fassert() failure"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">2018-10-24T18:05:18.248-04:00 W STORAGE [initandlisten] Detected unclean shutdown - mongod.lock is not empty.</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">2018-10-24T17:24:53.122-04:00 E STORAGE [initandlisten] Failed to get the cursor for uri: table:collection-2-6854866147293273505</td></tr><tr class=""><td class="leafygreen-ui-7razhx">2018-10-24T17:24:53.122-04:00 E STORAGE [initandlisten] This may be due to missing data files. ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">***aborting after fassert() failure</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In such cases, your <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.dbPath"> <code class="leafygreen-ui-1l06pbn"> dbPath </code> </a> contains a non-empty <code class="file docutils literal"> <span class="pre"> mongod.lock </span> </code> file. </p> <p class="leafygreen-ui-1kp3ins"> The following procedure uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--repair"> <code class="leafygreen-ui-1l06pbn"> mongod --repair </code> </a> to recover from these cases: </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Only use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--repair"> <code class="leafygreen-ui-1l06pbn"> mongod --repair </code> </a> if you have no other options. The operation removes and does not save any corrupt data during the repair process. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For the WiredTiger storage engine, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--repair"> <code class="leafygreen-ui-1l06pbn"> mongod --repair </code> : </a> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Rebuilds all indexes for collections with one or more inconsistent indexes. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Discards corrupt data. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Creates empty/stub files for missing data/metadata files. </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-tutorial-repair-procedures"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#procedure" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="procedure"> </div> </a> </h2> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Run the repair operation as the same user that normally runs the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process to avoid changing the permissions of the MongoDB data files. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Create a backup of the data files.Create a backup copy of the data files in the --dbpath."},{"@type":"HowToStep","text":"Start mongod with --repair.To repair the data files, start the mongod instance with\nthe --repair option.Issue a command similar to the following for your standalone:Upon completion, the dbpath should contain the repaired data files and an empty mongod.lock file. "}],"name":"Procedure","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create a backup of the data files. <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-backup-of-the-data-files" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-a-backup-of-the-data-files"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Create a backup copy of the data files in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--dbpath"> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> . </a> </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Start <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> with <code class="leafygreen-ui-1l06pbn"> --repair </code> . <a class="headerlink leafygreen-ui-1kepx47" href="#start-with-repair" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="start-with-repair"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To repair the data files, start the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--repair"> <code class="leafygreen-ui-1l06pbn"> --repair </code> </a> option. </p> <p class="leafygreen-ui-1kp3ins"> Issue a command similar to the following for your standalone: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --dbpath /data/db --repair\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --dbpath /data/db --repair</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Upon completion, the <code class="leafygreen-ui-1l06pbn"> dbpath </code> should contain the repaired data files and an empty <code class="leafygreen-ui-1l06pbn"> mongod.lock </code> file. <a class="footnote-reference header-buffer" href="#footnote-manual-removal" id="ref-manual-removal-id1"> [ <!-- --> 1 <!-- --> ] </a> </p> </section> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If the repair fails to complete for any reason, you must restart the instance with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--repair"> <code class="leafygreen-ui-1l06pbn"> --repair </code> </a> option to complete the repair. </p> </div> </div> <table class="header-buffer leafygreen-ui-rbqgrl" frame="void" id="footnote-manual-removal" rules="none"> <colgroup> <col/> </colgroup> <tbody valign="top"> <tr> <td class="leafygreen-ui-17r2xs0"> [ <a href="#ref-manual-removal-id1"> 1 </a> ] </td> <td class="leafygreen-ui-17r2xs0"> <!-- --> Generally, you should not manually remove the <code class="leafygreen-ui-1l06pbn"> mongod.lock </code> file. Instead, use the above procedure to recover the database. In dire situations, you can remove the file, start the database using the possibly corrupt files, and attempt to recover data from the database. However, it is impossible to predict the state of the database in these situations. </td> </tr> </tbody> </table> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/manage-shard-zone/update-existing-shard-zone/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Update an Existing Shard Zone <a class="headerlink leafygreen-ui-1kepx47" href="#update-an-existing-shard-zone" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="update-an-existing-shard-zone"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#about-this-task" target="_self"> <span> About this Task </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#before-you-begin" target="_self"> <span> Before you Begin </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#add-a-shard-to-a-zone-called-nyc" target="_self"> <span> Add a shard to a zone called NYC </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#specify-a-range-of-zipcode-values-for-the-nyc-zone" target="_self"> <span> Specify a range of zipcode values for the NYC zone </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#steps" target="_self"> <span> Steps </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#stop-the-balancer" target="_self"> <span> Stop the balancer </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#remove-the-current-nyc-range-from-the-zone" target="_self"> <span> Remove the current NYC range from the zone </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#update-the-zone-key-range-for-the-nyc-zone" target="_self"> <span> Update the zone key range for the NYC zone </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#restart-the-balancer" target="_self"> <span> Restart the balancer </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self"> <span> Learn More </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> After you specify a range of values for a shard zone, you can update the shard zone range if your application's requirements change. </p> <p class="leafygreen-ui-1kp3ins"> To update an existing shard zone, perform these steps: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Stop the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-balancer"> balancer <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Remove the old range from the zone. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Update the zone's range. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Restart the balancer. </p> </li> </ol> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> About this Task <a class="headerlink leafygreen-ui-1kepx47" href="#about-this-task" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="about-this-task"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Zone ranges are inclusive of the lower boundary and exclusive of the upper boundary. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> After you modify a zone, the balancer must migrate chunks to the appropriate zones based on the new range of values. Until balancing completes, some chunks may reside on the wrong shard given the configured zones for the sharded cluster. </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Before you Begin <a class="headerlink leafygreen-ui-1kepx47" href="#before-you-begin" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="before-you-begin"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To complete this tutorial, you must <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/deploy-shard-cluster/#std-label-sharding-procedure-setup"> deploy a sharded cluster </a> with a sharded collection and create a zone to modify. </p> <p class="leafygreen-ui-1kp3ins"> This example uses a sharded collection named <code class="leafygreen-ui-1l06pbn"> users </code> in the <code class="leafygreen-ui-1l06pbn"> records </code> database, sharded by the <code class="leafygreen-ui-1l06pbn"> zipcode </code> field. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Add a shard to a zone called NYC"},{"@type":"HowToStep","text":"Specify a range of zipcode values for the NYC zone"}],"name":"Before you Begin","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Add a shard to a zone called NYC <a class="headerlink leafygreen-ui-1kepx47" href="#add-a-shard-to-a-zone-called-nyc" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="add-a-shard-to-a-zone-called-nyc"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.addShardToZone(&lt;shard&gt;, \"NYC\")"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.addShardToZone(&lt;shard name&gt;, "NYC")</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Specify a range of zipcode values for the NYC zone <a class="headerlink leafygreen-ui-1kepx47" href="#specify-a-range-of-zipcode-values-for-the-nyc-zone" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="specify-a-range-of-zipcode-values-for-the-nyc-zone"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.updateZoneKeyRange(\"records.users\", { zipcode: \"10001\" }, { zipcode: \"10281\" }, \"NYC\" )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">updateZoneKeyRange</span>(<span class="lg-highlight-string">"records.users"</span>, <!-- -->{ <span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"10001"</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"10281"</span> }<!-- -->, <span class="lg-highlight-string">"NYC"</span> )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Steps <a class="headerlink leafygreen-ui-1kepx47" href="#steps" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="steps"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following procedure modifies the range of <code class="leafygreen-ui-1l06pbn"> zipcode </code> values for the <code class="leafygreen-ui-1l06pbn"> NYC </code> zone to be <code class="leafygreen-ui-1l06pbn"> 11201 </code> through <code class="leafygreen-ui-1l06pbn"> 11240 </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Stop the balancer"},{"@type":"HowToStep","text":"Remove the current NYC range from the zone"},{"@type":"HowToStep","text":"Update the zone key range for the NYC zone"},{"@type":"HowToStep","text":"Restart the balancer"}],"name":"Steps","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Stop the balancer <a class="headerlink leafygreen-ui-1kepx47" href="#stop-the-balancer" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="stop-the-balancer"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.stopBalancer()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">stopBalancer</span>(<!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Remove the current NYC range from the zone <a class="headerlink leafygreen-ui-1kepx47" href="#remove-the-current-nyc-range-from-the-zone" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="remove-the-current-nyc-range-from-the-zone"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.removeRangeFromZone(\"records.user\", { zipcode: \"10001\" }, { zipcode: \"10281\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">removeRangeFromZone</span>(<span class="lg-highlight-string">"records.user"</span>, <!-- -->{ <span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"10001"</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"10281"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Update the zone key range for the NYC zone <a class="headerlink leafygreen-ui-1kepx47" href="#update-the-zone-key-range-for-the-nyc-zone" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="update-the-zone-key-range-for-the-nyc-zone"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.updateZoneKeyRange(\"records.users\", { zipcode: \"11201\" }, { zipcode: \"11240\" }, \"NYC\" )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">updateZoneKeyRange</span>(<span class="lg-highlight-string">"records.users"</span>, <!-- -->{ <span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"11201"</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">zipcode</span>: <span class="lg-highlight-string">"11240"</span> }<!-- -->, <span class="lg-highlight-string">"NYC"</span> )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Restart the balancer <a class="headerlink leafygreen-ui-1kepx47" href="#restart-the-balancer" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="restart-the-balancer"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.startBalancer()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">startBalancer</span>(<!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.removeRangeFromZone/#mongodb-method-sh.removeRangeFromZone"> <code class="leafygreen-ui-1l06pbn"> sh.removeRangeFromZone() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.updateZoneKeyRange/#mongodb-method-sh.updateZoneKeyRange"> <code class="leafygreen-ui-1l06pbn"> sh.updateZoneKeyRange() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/workload-isolation/#std-label-workload-isolation"> Workload Isolation in MongoDB Deployments </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/stable-api-reference/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Migrate to a Later API Version <a class="headerlink leafygreen-ui-1kepx47" href="#migrate-to-a-later-api-version" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="migrate-to-a-later-api-version"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#compatibility-with-future-versions" target="_self"> <span> Compatibility with Future Versions </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility with Future Versions <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility-with-future-versions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility-with-future-versions"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The only API version that currently exists is <code class="leafygreen-ui-1l06pbn"> "1" </code> , but there will be new API versions released in the future. Upgrading your API version provides improved functionality and semantics for your application. </p> <p class="leafygreen-ui-1kp3ins"> Some API V1 commands and behaviors will be deprecated in future versions of the MongoDB server. Deprecated commands and behaviors are typically not included in the next API version. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Find Deprecated Commands and Behaviors <a class="headerlink leafygreen-ui-1kepx47" href="#find-deprecated-commands-and-behaviors" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="find-deprecated-commands-and-behaviors"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To migrate an existing application from API V1 to API V2, you must find and update all of the deprecated commands and behaviors features it uses. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"client = MongoClient(\n &lt;connection&gt;,\n api={\"version\": \"1\", \"strict\": True, \"deprecationErrors\": True}\n)"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">client = MongoClient(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;connection string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> api={"version": "1", "strict": True, "deprecationErrors": True}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The returns a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/stable-api/#std-label-api-deprecation-resp"> APIDeprecationError </a> if your application code tries to use commands and behaviors deprecated in API V1. Once your application tests pass and all deprecation errors have been fixed, you will be ready to test your application with API V2. </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/js-user-management/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> User Management Methods <a class="headerlink leafygreen-ui-1kepx47" href="#user-management-methods" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="user-management-methods"> </div> </a> </h1> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For details on a specific method, including syntax and examples, click on the link to the method's reference page. </p> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.auth/#mongodb-method-db.auth"> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Authenticates a user to a database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.changeUserPassword/#mongodb-method-db.changeUserPassword"> <code class="leafygreen-ui-1l06pbn"> db.changeUserPassword() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Changes an existing user's password. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createUser/#mongodb-method-db.createUser"> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a new user. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.dropUser/#mongodb-method-db.dropUser"> <code class="leafygreen-ui-1l06pbn"> db.dropUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes a single user. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.dropAllUsers/#mongodb-method-db.dropAllUsers"> <code class="leafygreen-ui-1l06pbn"> db.dropAllUsers() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deletes all users associated with a database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getUser/#mongodb-method-db.getUser"> <code class="leafygreen-ui-1l06pbn"> db.getUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns information about the specified user. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getUsers/#mongodb-method-db.getUsers"> <code class="leafygreen-ui-1l06pbn"> db.getUsers() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns information about all users associated with a database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.grantRolesToUser/#mongodb-method-db.grantRolesToUser"> <code class="leafygreen-ui-1l06pbn"> db.grantRolesToUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Grants a role and its privileges to a user. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.removeUser/#mongodb-method-db.removeUser"> <code class="leafygreen-ui-1l06pbn"> db.removeUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deprecated. Removes a user from a database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.revokeRolesFromUser/#mongodb-method-db.revokeRolesFromUser"> <code class="leafygreen-ui-1l06pbn"> db.revokeRolesFromUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes a role from a user. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.updateUser/#mongodb-method-db.updateUser"> <code class="leafygreen-ui-1l06pbn"> db.updateUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Updates user data. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prompts for the password as an alternative to specifying passwords directly in various <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> user authentication/management methods. </div> </div> </td> </tr> </tbody> </table> </div> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/vectorSearch/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $vectorSearch (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-vectorsearch--aggregation-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-vectorsearch--aggregation-"> </div> </a> </h1> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> $vectorSearch </code> performs a semantic search on data in your Atlas cluster. If you store vector embeddings that are less than or equal to 4096 dimensions in width for any kind of data along with other data in your collection on the Atlas cluster, you can seamlessly index the vector data along with your other data. You can then use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/#mongodb-pipeline-pipe.-vectorSearch" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $vectorSearch </code> </span> </a> stage to pre-filter your data and perform semantic search against the indexed fields. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> $vectorSearch </code> aggregation pipeline stage is only available for collections hosted on <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/" target="_self"> <span> MongoDB Atlas </span> </a> cluster tiers running MongoDB version 6.0.11 or later. To learn more, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-overview/" target="_self"> <span> Atlas Vector Search <!-- --> . </span> </a> </p> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You cannot use a <code class="leafygreen-ui-1l06pbn"> $vectorSearch </code> stage in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/facet/#mongodb-pipeline-pipe.-facet"> <code class="leafygreen-ui-1l06pbn"> $facet </code> </a> stage. </p> </div> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To learn more about creating Atlas Vector Search indexes, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/" target="_self"> <span> Index Vector Embeddings <!-- --> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To learn more about <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/#mongodb-pipeline-pipe.-vectorSearch" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $vectorSearch </code> </span> </a> pipeline stage syntax and usage, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/" target="_self"> <span> Vector Search Queries <!-- --> . </span> </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/data-modeling/schema-design-process/apply-patterns/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Apply Design Patterns <a class="headerlink leafygreen-ui-1kepx47" href="#apply-design-patterns" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="apply-design-patterns"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#about-this-task" target="_self"> <span> About this Task </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#movie-collection" target="_self"> <span> movie Collection </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#theater-collection" target="_self"> <span> theater Collection </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self"> <span> Learn More </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> Schema design patterns are ways to optimize your data model for your application's access patterns. They improve application performance and reduce schema complexity. Schema design patterns affect how your data is stored and what data is returned to your application. </p> <p class="leafygreen-ui-1kp3ins"> For a list of schema design patterns and examples, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/blog/post/building-with-patterns-a-summary" target="_self"> <span> Building with Patterns </span> </a> MongoDB blog series. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> About this Task <a class="headerlink leafygreen-ui-1kepx47" href="#about-this-task" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="about-this-task"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Before you implement schema design patterns, consider the problem that you are trying to solve. Each schema design pattern has different use cases and tradeoffs for data consistency, performance, and complexity. For example, some schema design patterns improve write performance, while others improve read performance. </p> <p class="leafygreen-ui-1kp3ins"> Implementing a pattern without understanding your application and the data it needs can degrade application performance and cause unnecessary complications to your schema design. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Consider the following example patterns used by a movie theater franchise: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The schema contains a <code class="leafygreen-ui-1l06pbn"> movie </code> collection and a <code class="leafygreen-ui-1l06pbn"> theater </code> collection. The schema uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/blog/post/building-with-patterns-the-subset-pattern" target="_self"> <span> subset pattern </span> </a> to duplicate a subset of information from the <code class="leafygreen-ui-1l06pbn"> movie </code> collection in the <code class="leafygreen-ui-1l06pbn"> theater </code> collection. The subset pattern reduces the size of documents returned to the application and improves read performance. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> movie </code> collection contains a <code class="leafygreen-ui-1l06pbn"> total_views </code> field, which uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/design-patterns/computed-values/computed-schema-pattern/#std-label-model-computed-data"> computed pattern </a> to calculate a running total of the number of times that customers view a movie across all of the theaters where the movie is shown. </p> </li> </ul> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> movie Collection <a class="headerlink leafygreen-ui-1kepx47" href="#movie-collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="movie-collection"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.movie.insertOne(\n {\n _id: 1,\n title: \"Titanic\",\n year: 1997,\n director: \"James Cameron\",\n runtime: 194,\n distributor: \"Paramount Pictures\",\n languages: [ \"English\" ],\n total_views: 3500\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">movie</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">title</span>: <span class="lg-highlight-string">"Titanic"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">year</span>: <span class="lg-highlight-number">1997</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">director</span>: <span class="lg-highlight-string">"James Cameron"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">runtime</span>: <span class="lg-highlight-number">194</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">distributor</span>: <span class="lg-highlight-string">"Paramount Pictures"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">languages</span>: <!-- -->[ <span class="lg-highlight-string">"English"</span> ]<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">total_views</span>: <span class="lg-highlight-number">3500</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> theater Collection <a class="headerlink leafygreen-ui-1kepx47" href="#theater-collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="theater-collection"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.theater.insertMany(\n [\n {\n name: \"Downtown Cinemas\",\n address: {\n street: \"2212 Taylor Street\",\n state: \"NY\"\n },\n movies: [\n {\n movie_id: 1,\n title: \"Titanic\",\n runtime: 194,\n views: 1500\n }\n ]\n },\n {\n name: \"Midtown Theater\",\n address: {\n street: \"1232 5th Street\",\n state: \"NY\"\n },\n movies: [\n {\n movie_id: 1,\n title: \"Titanic\",\n runtime: 194,\n views: 2000\n }\n ]\n }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">theater</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">"Downtown Cinemas"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">address</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">street</span>: <span class="lg-highlight-string">"2212 Taylor Street"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"NY"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">movies</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">movie_id</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">title</span>: <span class="lg-highlight-string">"Titanic"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">runtime</span>: <span class="lg-highlight-number">194</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">views</span>: <span class="lg-highlight-number">1500</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">"Midtown Theater"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">address</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">street</span>: <span class="lg-highlight-string">"1232 5th Street"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"NY"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">movies</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">movie_id</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">title</span>: <span class="lg-highlight-string">"Titanic"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">runtime</span>: <span class="lg-highlight-number">194</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">views</span>: <span class="lg-highlight-number">2000</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/applications/data-models-applications/#std-label-data-models-application-context"> Model Specific Application Contexts </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/handle-duplicate-data/#std-label-data-modeling-duplicate-data"> Handle Duplicate Data </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/data-consistency/#std-label-data-modeling-data-consistency"> Data Consistency </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/troubleshoot-kerberos/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Troubleshoot Self-Managed Kerberos Authentication <a class="headerlink leafygreen-ui-1kepx47" href="#troubleshoot-self-managed-kerberos-authentication" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="troubleshoot-self-managed-kerberos-authentication"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#mongokerberos-validation-tool" target="_self"> <span> <code class="css-1kekw28 e1wawog0"> mongokerberos </code> Validation Tool </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#kerberos-configuration-debugging-strategies" target="_self"> <span> Kerberos Configuration Debugging Strategies </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#kerberos-trace-logging-on-linux" target="_self"> <span> Kerberos Trace Logging on Linux </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#common-error-messages" target="_self"> <span> Common Error Messages </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> <code class="leafygreen-ui-1l06pbn"> mongokerberos </code> Validation Tool <a class="headerlink leafygreen-ui-1kepx47" href="#mongokerberos-validation-tool" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongokerberos-validation-tool"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongokerberos/#mongodb-binary-bin.mongokerberos"> <code class="leafygreen-ui-1l06pbn"> mongokerberos </code> </a> program provides a convenient method to verify your platform's Kerberos configuration for use with MongoDB, and to test that Kerberos authentication from a MongoDB client works as expected. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongokerberos/#mongodb-binary-bin.mongokerberos"> <code class="leafygreen-ui-1l06pbn"> mongokerberos </code> </a> tool can help diagnose common configuration issues, and is the recommended place to start when troubleshooting your Kerberos configuration. See the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongokerberos/#mongodb-binary-bin.mongokerberos"> <code class="leafygreen-ui-1l06pbn"> mongokerberos </code> </a> documentation for more information. </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongokerberos/#mongodb-binary-bin.mongokerberos"> <code class="leafygreen-ui-1l06pbn"> mongokerberos </code> </a> is available in MongoDB Enterprise only. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-kerberos-troubleshooting-checklist"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Kerberos Configuration Debugging Strategies <a class="headerlink leafygreen-ui-1kepx47" href="#kerberos-configuration-debugging-strategies" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="kerberos-configuration-debugging-strategies"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If you have difficulty starting or authenticating against <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> with <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/kerberos/"> Kerberos </a> , consider the following: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Ensure that you are running MongoDB Enterprise, not MongoDB Community Edition. Kerberos authentication is a MongoDB Enterprise feature and will not work with MongoDB Community Edition binaries. </p> <p class="leafygreen-ui-1kp3ins"> To verify that you are using MongoDB Enterprise, pass the <code class="leafygreen-ui-1l06pbn"> --version </code> command line option to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --version","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --version</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the output from this command, look for the string <code class="leafygreen-ui-1l06pbn"> modules: subscription </code> or <code class="leafygreen-ui-1l06pbn"> modules: enterprise </code> to confirm you are using the MongoDB Enterprise binaries. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Ensure that the canonical system hostname of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance is a resolvable, fully qualified domain name. </p> <p class="leafygreen-ui-1kp3ins"> On Linux, you can verify the system hostname resolution with the <code class="leafygreen-ui-1l06pbn"> hostname -f </code> command at the system prompt. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> On Linux, ensure that the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://web.mit.edu/KERBEROS/krb5-1.5/krb5-1.5.4/doc/krb5-user/What-is-a-Kerberos-Principal_003f.html" rel="noopener noreferrer"> <span> primary component of the service principal name (SPN) </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> of the SPN is <code class="leafygreen-ui-1l06pbn"> mongodb </code> . If the primary component of the SPN <strong> is not </strong> <code class="leafygreen-ui-1l06pbn"> mongodb </code> , you must specify the primary component using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.saslServiceName"> <code class="leafygreen-ui-1l06pbn"> --setParameter saslServiceName </code> . </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-kerberos-spn-matches-fqdn"> </span> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> On Linux, ensure that the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://web.mit.edu/KERBEROS/krb5-1.5/krb5-1.5.4/doc/krb5-user/What-is-a-Kerberos-Principal_003f.html" rel="noopener noreferrer"> <span> instance component of the service principal name (SPN) </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/kerberos/#std-label-keytab-files"> keytab file </a> matches the canonical system hostname of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance. If the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance's system hostname is not in the keytab file, authentication will fail with a <code class="leafygreen-ui-1l06pbn"> GSSAPI error acquiring credentials. </code> error message. </p> <p class="leafygreen-ui-1kp3ins"> If the hostname of your <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance as returned by <code class="leafygreen-ui-1l06pbn"> hostname -f </code> is not fully qualified, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.saslHostName"> <code class="leafygreen-ui-1l06pbn"> --setParameter saslHostName </code> </a> to set the instance's fully qualified domain name when starting your <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Ensure that each host that runs a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance has <code class="leafygreen-ui-1l06pbn"> A </code> and <code class="leafygreen-ui-1l06pbn"> PTR </code> DNS records to provide both forward and reverse DNS lookup. The <code class="leafygreen-ui-1l06pbn"> A </code> record should map to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> 's FQDN. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Ensure that clocks on the servers hosting your MongoDB instances and Kerberos infrastructure are within the maximum time skew: 5 minutes by default. Time differences greater than the maximum time skew prevent successful authentication. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Ensure that Linux KRB5 keytabs contain principal names that end in <code class="leafygreen-ui-1l06pbn"> @&lt;KERBEROS REALM&gt; </code> . To validate <span class="leafygreen-ui-vm4wms" tabindex="0"> SPNs </span> , run <code class="leafygreen-ui-1l06pbn"> setspn -Q &lt;spn&gt; </code> on Active Directory. If correctly configured, this command returns one Distinguished Name for the account that is attached to the SPN. If you run <code class="leafygreen-ui-1l06pbn"> klist -k &lt;keytab&gt; </code> on Linux, <code class="leafygreen-ui-1l06pbn"> &lt;spn&gt;@&lt;KERBEROS REALM&gt; </code> appears in the keytab. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you use Active Directory as a <span class="leafygreen-ui-vm4wms" tabindex="0"> KDC </span> , ensure that the MongoDB service account is a user account, not a machine account. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you use <span class="leafygreen-ui-vm4wms" tabindex="0"> AES </span> encryption with Active Directory, enable AES on the MongoDB service account with either the <code class="leafygreen-ui-1l06pbn"> msDS-SupportedEncryptionTypes </code> property or the "Network Security: Configure Encryption types allowed for Kerberos" policy setting. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Kerberos salts its key generation algorithms to ensure that two users with the same password result in distinct keys. <code class="leafygreen-ui-1l06pbn"> ktutil </code> on Linux and Active Directory (AD) don't use the same process to generate salts. This discrepancy can result in authentication failures when working across Linux and Windows environments. To mitigate this issue, you can: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Generate the keytab file on the AD server and move the resulting file to the Linux server. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"ktpass /out &lt;outfile.keytab&gt; /princ &lt;spn&gt;@&lt;kerberos&gt; /mapuser &lt;current&gt; /crypto ALL /ptype KRB5_NT_PRINCIPAL +rndpass","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">ktpass <!-- -->/out<!-- --> &lt;outfile.keytab&gt; <!-- -->/princ<!-- --> &lt;spn&gt;@&lt;KERBEROS REALM&gt; <!-- -->/mapuser<!-- --> &lt;current userPrincipalName&gt; <!-- -->/crypto<!-- --> ALL <!-- -->/ptype<!-- --> KRB5_NT_PRINCIPAL +rndpass</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This will change <code class="leafygreen-ui-1l06pbn"> userPrincipalName </code> to the value in <code class="leafygreen-ui-1l06pbn"> /princ </code> . </p> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use <code class="leafygreen-ui-1l06pbn"> ktutil </code> on Linux and force it to use the correct salt. To force <code class="leafygreen-ui-1l06pbn"> ktutil </code> to use the correct salt: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Generate a keytab entry that uses <code class="leafygreen-ui-1l06pbn"> userPrincipalName </code> as the principal name. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"ktutil: add_entry -password -p &lt;userprincipalname&gt;@&lt;kerberos&gt; -e aes256-cts-hmac-sha1-96 -k &lt;kvno&gt;\nPassword for &lt;userprincipalname&gt;@&lt;kerberos&gt;:\nktutil: list -k\nslot KVNO Principal","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">ktutil: add_entry -password -p &lt;userPrincipalName&gt;@&lt;KERBEROS REALM&gt; -e aes256-cts-hmac-sha1-96 -k &lt;KVNO&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">Password <span class="lg-highlight-keyword">for</span> &lt;userPrincipalName&gt;@&lt;KERBEROS REALM&gt;:</td></tr><tr class=""><td class="leafygreen-ui-7razhx">ktutil: list -k</td></tr><tr class=""><td class="leafygreen-ui-7razhx">slot KVNO Principal</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Hexdump the key. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create a new keytab entry, using <code class="leafygreen-ui-1l06pbn"> &lt;spn&gt;@&lt;KERBEROS REALM&gt; </code> as the principal name and use the hexdumped key. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"1 &lt;kvno&gt; &lt;userprincipalname&gt;@&lt;kerberos&gt;(0x&lt;hexdump&gt;)\nktutil: add_entry -key -p &lt;spn&gt;@&lt;kerberos&gt; -e aes256-cts-hmac-sha1-96 -k &lt;kvno&gt;\nKey for &lt;spn&gt;@&lt;kerberos&gt; (hex): &lt;hexdump&gt;\nktutil: write_kt mongodb_ad.keytab","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">1 &lt;KVNO&gt; &lt;userPrincipalName&gt;@&lt;KERBEROS REALM&gt;(0x&lt;HEXDUMP&gt;)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">ktutil: add_entry -key -p &lt;spn&gt;@&lt;KERBEROS REALM&gt; -e aes256-cts-hmac-sha1-96 -k &lt;KVNO&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">Key <span class="lg-highlight-keyword">for</span> &lt;spn&gt;@&lt;KERBEROS REALM&gt; (hex): &lt;HEXDUMP&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">ktutil: write_kt mongodb_ad.keytab</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ol> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use RC4-HMAC, which does not use salts, although this is not recommended. </p> </li> </ul> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Kerberos Trace Logging on Linux <a class="headerlink leafygreen-ui-1kepx47" href="#kerberos-trace-logging-on-linux" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="kerberos-trace-logging-on-linux"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> MIT Kerberos provides the <code class="leafygreen-ui-1l06pbn"> KRB5_TRACE </code> environment variable for trace logging output. If you are having persistent problems with MIT Kerberos on Linux, you can set <code class="leafygreen-ui-1l06pbn"> KRB5_TRACE </code> when starting your <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> instances to produce verbose logging. </p> <p class="leafygreen-ui-1kp3ins"> For example, the following command starts a standalone <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> whose keytab file is at the default <code class="leafygreen-ui-1l06pbn"> /etc/krb5.keytab </code> path and sets <code class="leafygreen-ui-1l06pbn"> KRB5_TRACE </code> to write to <code class="leafygreen-ui-1l06pbn"> /logs/mongodb-kerberos.log </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"env KRB5_KTNAME=/etc/krb5.keytab \\\n KRB5_TRACE=/logs/mongodb-kerberos.log \\\n mongod --dbpath /data/db --logpath /data/db/mongodb.log \\\n --auth --setParameter authenticationMechanisms=GSSAPI \\\n --bind_ip localhost,&lt;hostname(s)|ip&gt; --fork","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-built_in">env</span> KRB5_KTNAME=<!-- -->/etc/krb<!-- -->5.keytab \</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> KRB5_TRACE=<!-- -->/logs/mongodb-kerberos.log<!-- --> \</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> mongod --dbpath <!-- -->/data/db<!-- --> --logpath <!-- -->/data/db/mongodb.log<!-- --> \</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> --auth --setParameter authenticationMechanisms=GSSAPI \</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> --bind_ip localhost,&lt;hostname(s)|ip address(es)&gt; --fork</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Common Error Messages <a class="headerlink leafygreen-ui-1kepx47" href="#common-error-messages" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="common-error-messages"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> In some situations, MongoDB will return error messages from the GSSAPI interface if there is a problem with the Kerberos service. Some common error messages are: </p> <dl> <dt> <code class="leafygreen-ui-1l06pbn"> GSSAPI error in client while negotiating security context. </code> </dt> <dd class="css-1ufxuu7"> <p class="leafygreen-ui-1kp3ins"> This error occurs on the client and reflects insufficient credentials or a malicious attempt to authenticate. </p> <p class="leafygreen-ui-1kp3ins"> If you receive this error, ensure that you are using the correct credentials and the correct fully qualified domain name when connecting to the host. </p> </dd> <dt> <code class="leafygreen-ui-1l06pbn"> GSSAPI error acquiring credentials. </code> </dt> <dd class="css-1ufxuu7"> This error occurs during the start of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> and reflects improper configuration of the system hostname or a missing or incorrectly configured keytab file. </dd> </dl> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/kerberos/"> Kerberos Authentication on Self-Managed Deployments </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/control-access-to-mongodb-with-kerberos-authentication/"> Configure Self-Managed MongoDB with Kerberos Authentication on Linux </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/control-access-to-mongodb-windows-with-kerberos-authentication/"> Configure Self-Managed MongoDB with Kerberos Authentication on Windows </a> </p> </li> </ul> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/db.printSecondaryReplicationInfo/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.printSecondaryReplicationInfo() <a class="headerlink leafygreen-ui-1kepx47" href="#db.printsecondaryreplicationinfo--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="db.printsecondaryreplicationinfo--"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#output" target="_self"> <span> Output </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.printSecondaryReplicationInfo() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.printSecondaryReplicationInfo" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-db.printSecondaryReplicationInfo"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Prints a formatted report of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> status from the perspective of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary"> secondary </a> member of the set. The output is identical to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.printSecondaryReplicationInfo/#mongodb-method-rs.printSecondaryReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> rs.printSecondaryReplicationInfo() </code> </a> method. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Output <a class="headerlink leafygreen-ui-1kepx47" href="#output" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="output"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Example <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.printSecondaryReplicationInfo" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.printSecondaryReplicationInfo() </code> </span> </a> output when run on a replica set with two secondary members: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"source: m1.example.net:27002\n syncedTo: Mon Mar 01 2021 16:30:50 GMT-0800 (PST)\n 0 secs (0 hrs) behind the primary\nsource: m2.example.net:27003\n syncedTo: Mon Mar 01 2021 16:30:50 GMT-0800 (PST)\n 0 secs (0 hrs) behind the primary","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">source</span>: <!-- -->m1.<span class="lg-highlight-property">example</span>.<span class="lg-highlight-property">net</span>:<span class="lg-highlight-number">27002</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">syncedTo</span>: <span class="lg-highlight-title lg-highlight-class">Mon</span> <span class="lg-highlight-title lg-highlight-class">Mar</span> <span class="lg-highlight-number">01</span> <span class="lg-highlight-number">2021</span> <span class="lg-highlight-number">16</span>:<span class="lg-highlight-number">30</span>:<span class="lg-highlight-number">50</span> <span class="lg-highlight-variable lg-highlight-constant">GMT</span>-<span class="lg-highlight-number">0800</span> <!-- -->(<span class="lg-highlight-variable lg-highlight-constant">PST</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-number">0</span> secs <!-- -->(<span class="lg-highlight-number">0</span> hrs) behind the primary</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">source</span>: <!-- -->m2.<span class="lg-highlight-property">example</span>.<span class="lg-highlight-property">net</span>:<span class="lg-highlight-number">27003</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">syncedTo</span>: <span class="lg-highlight-title lg-highlight-class">Mon</span> <span class="lg-highlight-title lg-highlight-class">Mar</span> <span class="lg-highlight-number">01</span> <span class="lg-highlight-number">2021</span> <span class="lg-highlight-number">16</span>:<span class="lg-highlight-number">30</span>:<span class="lg-highlight-number">50</span> <span class="lg-highlight-variable lg-highlight-constant">GMT</span>-<span class="lg-highlight-number">0800</span> <!-- -->(<span class="lg-highlight-variable lg-highlight-constant">PST</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-number">0</span> secs <!-- -->(<span class="lg-highlight-number">0</span> hrs) behind the primary</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.printSecondaryReplicationInfo" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.printSecondaryReplicationInfo() </code> </span> </a> method run in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> does <strong> not </strong> return <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-JSON"> JSON </a> . Use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.printSecondaryReplicationInfo" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.printSecondaryReplicationInfo() </code> </span> </a> for manual inspection, and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> in scripts. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> A <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-delayed-member/#std-label-replica-set-delayed-members"> delayed member </a> may show as <code class="leafygreen-ui-1l06pbn"> 0 </code> seconds behind the primary when the inactivity period on the primary is greater than the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members-n-.secondaryDelaySecs"> <code class="leafygreen-ui-1l06pbn"> members[n].secondaryDelaySecs </code> </a> value. </p> <p class="leafygreen-ui-1kp3ins"> A member may show a negative time value behind the primary when <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.printSecondaryReplicationInfo" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.printSecondaryReplicationInfo() </code> </span> </a> is run. This is expected if <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.printSecondaryReplicationInfo" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.printSecondaryReplicationInfo() </code> </span> </a> is run after a secondary replicates a write that follows a period of inactivity, but before the secondary receives a heartbeat from the primary with the latest <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-optime"> optime <!-- --> . </a> </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The lag reported by secondaries may not be representative of cluster health. Negative values do not indicate that the secondary is ahead of the primary. </p> <p class="leafygreen-ui-1kp3ins"> To obtain the most current status for your replica set, run <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.printSecondaryReplicationInfo" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.printSecondaryReplicationInfo() </code> </span> </a> on the primary. </p> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/abortMoveCollection/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> abortMoveCollection <a class="headerlink leafygreen-ui-1kepx47" href="#abortmovecollection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="abortmovecollection"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#command-fields" target="_self"> <span> Command Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self"> <span> Learn More </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> abortMoveCollection </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.abortMoveCollection" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-dbcommand-dbcmd.abortMoveCollection"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Stops an in-progress <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/moveCollection/#mongodb-dbcommand-dbcmd.moveCollection"> <code class="leafygreen-ui-1l06pbn"> moveCollection </code> </a> operation. </p> <div> <p> <em> New <!-- --> in version <!-- --> 8.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> This command must run on the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is not available on the Atlas Shared Tier or on Atlas Serverless. </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( {\n abortMoveCollection: \"&lt;database&gt;.&lt;collection&gt;\"\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">abortMoveCollection</span>: <span class="lg-highlight-string">"&lt;database&gt;.&lt;collection&gt;"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Command Fields <a class="headerlink leafygreen-ui-1kepx47" href="#command-fields" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="command-fields"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:10%"/> <col style="width:10%"/> <col style="width:60%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Necessity </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> abortMoveCollection </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Required </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the database and collection to stop moving. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example stops the in-progress move of the <code class="leafygreen-ui-1l06pbn"> sales.us_accounts </code> collection to a new shard. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( {\n abortMoveCollection: \"sales.us_accounts\"\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">abortMoveCollection</span>: <span class="lg-highlight-string">"sales.us_accounts"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.abortMoveCollection/#mongodb-method-sh.abortMoveCollection"> <code class="leafygreen-ui-1l06pbn"> sh.abortMoveCollection() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/stop-moving-a-collection/#std-label-task-stop-moving-a-collection"> Stop Moving a Collection </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/setWindowFields/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $setWindowFields (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-setwindowfields--aggregation-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-setwindowfields--aggregation-"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#window-operators" target="_self"> <span> Window Operators </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#restrictions" target="_self"> <span> Restrictions </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="pipeline"> <dt> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-pipeline-pipe.-setWindowFields" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-pipeline-pipe.-setWindowFields"> </div> </a> </dt> <dd> </dd> </dl> <div> <p> <em> New <!-- --> in version <!-- --> 5.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Performs operations on a specified span of documents in a collection, known as a <em> window </em> , and returns the results based on the chosen <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window-operators" target="_self"> <span> window operator <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> For example, you can use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> stage to output the: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Difference in sales between two documents in a collection. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Sales rankings. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Cumulative sales totals. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Analysis of complex time series information without exporting the data to an external database. </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-syntax"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> stage syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n $setWindowFields: {\n partitionBy: &lt;expression&gt;,\n sortBy: {\n &lt;sort&gt;: &lt;sort&gt;,\n &lt;sort&gt;: &lt;sort&gt;,\n ...,\n &lt;sort&gt;: &lt;sort&gt;\n },\n output: {\n &lt;output&gt;: {\n &lt;window&gt;: &lt;window&gt;,\n window: {\n documents: [ &lt;lower&gt;, &lt;upper&gt; ],\n range: [ &lt;lower&gt;, &lt;upper&gt; ],\n unit: <time>\n }\n },\n &lt;output&gt;: { ... },\n ...\n &lt;output&gt;: { ... }\n }\n }\n}</time>"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> $setWindowFields: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> partitionBy: &lt;expression&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> sortBy: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;sort field 1&gt;: &lt;sort order&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;sort field 2&gt;: &lt;sort order&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;sort field n&gt;: &lt;sort order&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> output: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;output field 1&gt;: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;window operator&gt;: &lt;window operator parameters&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> window: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> documents: [ &lt;lower boundary&gt;, &lt;upper boundary&gt; ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> range: [ &lt;lower boundary&gt;, &lt;upper boundary&gt; ],</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> unit: &lt;time unit&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;output field 2&gt;: { ... },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;output field n&gt;: { ... }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> stage takes a document with these fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:15%"/> <col style="width:15%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Necessity </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-partitionBy" target="_self"> <span> partitionBy </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-partitionBy"> </span> <p class="leafygreen-ui-1kp3ins"> Specifies an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> to group the documents. In the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> stage, the group of documents is known as a <em> partition </em> . Default is one partition for the entire collection. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sortBy </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Required for some operators (see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-restrictions" target="_self"> <span> Restrictions <!-- --> ) </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-sortBy"> </span> <p class="leafygreen-ui-1kp3ins"> Specifies the field(s) to sort the documents by in the partition. Uses the same syntax as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sort/#mongodb-pipeline-pipe.-sort"> <code class="leafygreen-ui-1l06pbn"> $sort </code> </a> stage. Default is no sorting. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-output" target="_self"> <span> output </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Required </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-output"> </span> <p class="leafygreen-ui-1kp3ins"> Specifies the field(s) to append to the documents in the output returned by the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> stage. Each field is set to the result returned by the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window-operators" target="_self"> <span> window operator <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> A field can contain <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/document/#std-label-document-dot-notation"> dots </a> to specify embedded document fields and array fields. The semantics for the embedded document dotted notation in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> stage are the same as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/addFields/#mongodb-pipeline-pipe.-addFields"> <code class="leafygreen-ui-1l06pbn"> $addFields </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/set/#mongodb-pipeline-pipe.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> stages. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/addFields/#std-label-add-field-to-embedded"> embedded document $addFields example </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/set/#std-label-set-add-field-to-embedded"> embedded document $set example <!-- --> . </a> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> window operator </code> is the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window-operators" target="_self"> <span> window operator </span> </a> name to use in the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> stage. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> window operator parameters </code> are the parameters to pass to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window-operators" target="_self"> <span> window operator <!-- --> . </span> </a> </p> </li> </ul> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window" target="_self"> <span> window </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-window"> </span> <p class="leafygreen-ui-1kp3ins"> Specifies the window boundaries and parameters. Window boundaries are inclusive. Default is an unbounded window, which includes all documents in the partition. </p> <p class="leafygreen-ui-1kp3ins"> Specify either a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents" target="_self"> <span> documents </span> </a> or <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range" target="_self"> <span> range </span> </a> window. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents" target="_self"> <span> documents </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-documents"> </span> <p class="leafygreen-ui-1kp3ins"> A window where the lower and upper boundaries are specified relative to the position of the current document read from the collection. </p> <p class="leafygreen-ui-1kp3ins"> The window boundaries are specified using a two element array containing a lower and upper limit string or integer. Use: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> "current" </code> string for the current document position in the output. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> "unbounded" </code> string for the first or last document position in the partition. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> An integer for a position relative to the current document. Use a negative integer for a position before the current document. Use a positive integer for a position after the current document. <code class="leafygreen-ui-1l06pbn"> 0 </code> is the current document position. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents-window-examples" target="_self"> <span> Documents Window Examples <!-- --> . </span> </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range" target="_self"> <span> range </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-range"> </span> <p class="leafygreen-ui-1kp3ins"> A window where the lower and upper boundaries are defined using a range of values based on the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sortBy </span> </a> field in the current document. </p> <p class="leafygreen-ui-1kp3ins"> The window boundaries are specified using a two element array containing a lower and upper limit string or number. Use: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> "current" </code> string for the current document position in the output. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> "unbounded" </code> string for the first or last document position in the partition. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A number to add to the value of the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sortBy </span> </a> field for the current document. A document is in the window if the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sortBy </span> </a> field value is inclusively within the lower and upper boundaries. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range-window-example" target="_self"> <span> Range Window Example <!-- --> . </span> </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-unit" target="_self"> <span> unit </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-unit"> </span> <p class="leafygreen-ui-1kp3ins"> Specifies the units for time <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range" target="_self"> <span> range </span> </a> window boundaries. Can be set to one of these strings: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "year" </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "quarter" </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "month" </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "week" </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "day" </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "hour" </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "minute" </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "second" </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "millisecond" </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If omitted, default numeric <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range" target="_self"> <span> range </span> </a> window boundaries are used. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-time-range-window-examples" target="_self"> <span> Time Range Window Examples <!-- --> . </span> </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-examples" target="_self"> <span> Examples </span> </a> </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> stage appends new fields to existing documents. You can include one or more <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> stages in an aggregation operation. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.3, you can use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> stage with <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions"> transactions </a> and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-snapshot/#mongodb-readconcern-readconcern.-snapshot-"> <code class="leafygreen-ui-1l06pbn"> "snapshot" </code> </a> read concern. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> stage doesn't guarantee the order of the returned documents. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-window-operators"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Window Operators <a class="headerlink leafygreen-ui-1kepx47" href="#window-operators" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="window-operators"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> These operators can be used with the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> stage: </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-accumulator-operators"> </span> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Accumulator operators: <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/addToSet/#mongodb-group-grp.-addToSet"> <code class="leafygreen-ui-1l06pbn"> $addToSet </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/avg/#mongodb-group-grp.-avg"> <code class="leafygreen-ui-1l06pbn"> $avg </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/bottom/#mongodb-group-grp.-bottom"> <code class="leafygreen-ui-1l06pbn"> $bottom </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/bottomN/#mongodb-group-grp.-bottomN"> <code class="leafygreen-ui-1l06pbn"> $bottomN </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/count-accumulator/#mongodb-group-grp.-count"> <code class="leafygreen-ui-1l06pbn"> $count </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/covariancePop/#mongodb-group-grp.-covariancePop"> <code class="leafygreen-ui-1l06pbn"> $covariancePop </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/covarianceSamp/#mongodb-group-grp.-covarianceSamp"> <code class="leafygreen-ui-1l06pbn"> $covarianceSamp </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/derivative/#mongodb-group-grp.-derivative"> <code class="leafygreen-ui-1l06pbn"> $derivative </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/expMovingAvg/#mongodb-group-grp.-expMovingAvg"> <code class="leafygreen-ui-1l06pbn"> $expMovingAvg </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/firstN/#mongodb-group-grp.-firstN"> <code class="leafygreen-ui-1l06pbn"> $firstN </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/integral/#mongodb-group-grp.-integral"> <code class="leafygreen-ui-1l06pbn"> $integral </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/lastN/#mongodb-group-grp.-lastN"> <code class="leafygreen-ui-1l06pbn"> $lastN </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/max/#mongodb-group-grp.-max"> <code class="leafygreen-ui-1l06pbn"> $max </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/maxN/#mongodb-group-grp.-maxN"> <code class="leafygreen-ui-1l06pbn"> $maxN </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/median/#mongodb-group-grp.-median"> <code class="leafygreen-ui-1l06pbn"> $median </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/min/#mongodb-group-grp.-min"> <code class="leafygreen-ui-1l06pbn"> $min </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/minN/#mongodb-group-grp.-minN"> <code class="leafygreen-ui-1l06pbn"> $minN </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/percentile/#mongodb-group-grp.-percentile"> <code class="leafygreen-ui-1l06pbn"> $percentile </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/push/#mongodb-group-grp.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/stdDevSamp/#mongodb-group-grp.-stdDevSamp"> <code class="leafygreen-ui-1l06pbn"> $stdDevSamp </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/stdDevPop/#mongodb-group-grp.-stdDevPop"> <code class="leafygreen-ui-1l06pbn"> $stdDevPop </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sum/#mongodb-group-grp.-sum"> <code class="leafygreen-ui-1l06pbn"> $sum </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/top/#mongodb-group-grp.-top"> <code class="leafygreen-ui-1l06pbn"> $top </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/topN/#mongodb-group-grp.-topN"> <code class="leafygreen-ui-1l06pbn"> $topN </code> . </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-gap-filling-operators"> </span> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Gap filling operators: <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/linearFill/#mongodb-group-grp.-linearFill"> <code class="leafygreen-ui-1l06pbn"> $linearFill </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/locf/#mongodb-group-grp.-locf"> <code class="leafygreen-ui-1l06pbn"> $locf </code> . </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-order-operators"> </span> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Order operators: <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/first/#mongodb-group-grp.-first"> <code class="leafygreen-ui-1l06pbn"> $first </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/last/#mongodb-group-grp.-last"> <code class="leafygreen-ui-1l06pbn"> $last </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/shift/#mongodb-group-grp.-shift"> <code class="leafygreen-ui-1l06pbn"> $shift </code> . </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-rank-operators"> </span> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Rank operators: <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/denseRank/#mongodb-group-grp.-denseRank"> <code class="leafygreen-ui-1l06pbn"> $denseRank </code> </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/documentNumber/#mongodb-group-grp.-documentNumber"> <code class="leafygreen-ui-1l06pbn"> $documentNumber </code> </a> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/rank/#mongodb-group-grp.-rank"> <code class="leafygreen-ui-1l06pbn"> $rank </code> . </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-restrictions"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Restrictions <a class="headerlink leafygreen-ui-1kepx47" href="#restrictions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="restrictions"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Restrictions for the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> stage: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Prior to MongoDB 5.3, the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> stage cannot be used: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Within <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions"> transactions <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> With <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-snapshot/#mongodb-readconcern-readconcern.-snapshot-"> <code class="leafygreen-ui-1l06pbn"> "snapshot" </code> </a> read concern. </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sortBy </span> </a> is required for: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-rank-operators" target="_self"> <span> Rank </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-order-operators" target="_self"> <span> order </span> </a> window operators. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Bounded windows (either a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents" target="_self"> <span> documents </span> </a> window or a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range" target="_self"> <span> range </span> </a> window). </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/linearFill/#mongodb-group-grp.-linearFill"> <code class="leafygreen-ui-1l06pbn"> $linearFill </code> </a> operator. </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range" target="_self"> <span> Range </span> </a> windows require all <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sortBy </span> </a> values to be numbers. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-unit" target="_self"> <span> Time range </span> </a> windows require all <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sortBy </span> </a> values to be dates. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range" target="_self"> <span> Range </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-unit" target="_self"> <span> time range </span> </a> windows can only contain one <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sortBy </span> </a> field and the sort must be ascending. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot specify both a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents" target="_self"> <span> documents </span> </a> window and a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range" target="_self"> <span> range </span> </a> window. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> These operators use an implicit window and return an error if you specify a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window" target="_self"> <span> window </span> </a> option: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-rank-operators" target="_self"> <span> Rank </span> </a> operators. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/shift/#mongodb-group-grp.-shift"> <code class="leafygreen-ui-1l06pbn"> $shift </code> </a> operator. </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range" target="_self"> <span> range </span> </a> windows, only numbers in the specified range are included in the window. Missing, undefined, and <code class="leafygreen-ui-1l06pbn"> null </code> values are excluded. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-unit" target="_self"> <span> time range </span> </a> windows: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Only date and time types are included in the window. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Numeric boundary values must be integers. For example, you can use 2 hours as a boundary but you cannot use 1.5 hours. </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For empty windows or windows with incompatible values (for example, using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sum/#mongodb-group-grp.-sum"> <code class="leafygreen-ui-1l06pbn"> $sum </code> </a> on strings), the returned value depends on the operator: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/count-accumulator/#mongodb-group-grp.-count"> <code class="leafygreen-ui-1l06pbn"> $count </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sum/#mongodb-group-grp.-sum"> <code class="leafygreen-ui-1l06pbn"> $sum </code> </a> , the returned value is <code class="leafygreen-ui-1l06pbn"> 0 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/addToSet/#mongodb-group-grp.-addToSet"> <code class="leafygreen-ui-1l06pbn"> $addToSet </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/push/#mongodb-group-grp.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> , the returned value is an empty array. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> For all other operators, the returned value is <code class="leafygreen-ui-1l06pbn"> null </code> . </p> </li> </ul> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-examples"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Create a <code class="leafygreen-ui-1l06pbn"> cakeSales </code> collection that contains cake sales in the states of California ( <code class="leafygreen-ui-1l06pbn"> CA </code> ) and Washington ( <code class="leafygreen-ui-1l06pbn"> WA </code> ): </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.insertMany( [\n { _id: 0, type: \"chocolate\", orderDate: new Date(\"2020-05-18T14:10:30Z\"),\n state: \"CA\", price: 13, quantity: 120 },\n { _id: 1, type: \"chocolate\", orderDate: new Date(\"2021-03-20T11:30:05Z\"),\n state: \"WA\", price: 14, quantity: 140 },\n { _id: 2, type: \"vanilla\", orderDate: new Date(\"2021-01-11T06:31:15Z\"),\n state: \"CA\", price: 12, quantity: 145 },\n { _id: 3, type: \"vanilla\", orderDate: new Date(\"2020-02-08T13:13:23Z\"),\n state: \"WA\", price: 13, quantity: 104 },\n { _id: 4, type: \"strawberry\", orderDate: new Date(\"2019-05-18T16:09:01Z\"),\n state: \"CA\", price: 41, quantity: 162 },\n { _id: 5, type: \"strawberry\", orderDate: new Date(\"2019-01-08T06:12:03Z\"),\n state: \"WA\", price: 43, quantity: 134 }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">120</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">140</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">145</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">104</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">162</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">type</span>: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-keyword">new</span> <span class="lg-highlight-title lg-highlight-class">Date</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">state</span>: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">134</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following examples use the <code class="leafygreen-ui-1l06pbn"> cakeSales </code> collection. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-documents-window-examples"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Documents Window Examples <a class="headerlink leafygreen-ui-1kepx47" href="#documents-window-examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="documents-window-examples"> </div> </a> </h3> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Use Documents Window to Obtain Cumulative Quantity for Each State <a class="headerlink leafygreen-ui-1kepx47" href="#use-documents-window-to-obtain-cumulative-quantity-for-each-state" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-documents-window-to-obtain-cumulative-quantity-for-each-state"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> This example uses a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents" target="_self"> <span> documents </span> </a> window in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> to output the cumulative cake sales <code class="leafygreen-ui-1l06pbn"> quantity </code> for each <code class="leafygreen-ui-1l06pbn"> state </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.aggregate( [\n {\n $setWindowFields: {\n partitionBy: \"$state\",\n sortBy: { orderDate: 1 },\n output: {\n cumulativeQuantityForState: {\n $sum: \"$quantity\",\n window: {\n documents: [ \"unbounded\", \"current\" ]\n }\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <span class="lg-highlight-string">"$state"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">cumulativeQuantityForState</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$sum</span>: <span class="lg-highlight-string">"$quantity"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">window</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">documents</span>: <!-- -->[ <span class="lg-highlight-string">"unbounded"</span>, <span class="lg-highlight-string">"current"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> partitionBy: "$state" </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-partitionBy" target="_self"> <span> partitions </span> </a> the documents in the collection by <code class="leafygreen-ui-1l06pbn"> state </code> . There are partitions for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sortBy: { orderDate: 1 } </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sorts </span> </a> the documents in each partition by <code class="leafygreen-ui-1l06pbn"> orderDate </code> in ascending order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ), so the earliest <code class="leafygreen-ui-1l06pbn"> orderDate </code> is first. </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> output </code> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Sets the <code class="leafygreen-ui-1l06pbn"> cumulativeQuantityForState </code> field to the cumulative <code class="leafygreen-ui-1l06pbn"> quantity </code> for each <code class="leafygreen-ui-1l06pbn"> state </code> , which increases by successive additions to the previous value in the partition. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Calculates the cumulative <code class="leafygreen-ui-1l06pbn"> quantity </code> using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sum/#mongodb-group-grp.-sum"> <code class="leafygreen-ui-1l06pbn"> $sum </code> </a> operator run in a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents" target="_self"> <span> documents </span> </a> window. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window" target="_self"> <span> window </span> </a> contains documents between an <code class="leafygreen-ui-1l06pbn"> unbounded </code> lower limit and the <code class="leafygreen-ui-1l06pbn"> current </code> document. This means <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sum/#mongodb-group-grp.-sum"> <code class="leafygreen-ui-1l06pbn"> $sum </code> </a> returns the cumulative <code class="leafygreen-ui-1l06pbn"> quantity </code> for the documents between the beginning of the partition and the current document. </p> </li> </ul> </li> </ul> <p class="leafygreen-ui-1kp3ins"> In this example output, the cumulative <code class="leafygreen-ui-1l06pbn"> quantity </code> for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> is shown in the <code class="leafygreen-ui-1l06pbn"> cumulativeQuantityForState </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 4, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-05-18T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 41, \"quantity\" : 162, \"cumulativeQuantityForState\" : 162 }\n{ \"_id\" : 0, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2020-05-18T14:10:30Z\"),\n \"state\" : \"CA\", \"price\" : 13, \"quantity\" : 120, \"cumulativeQuantityForState\" : 282 }\n{ \"_id\" : 2, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2021-01-11T06:31:15Z\"),\n \"state\" : \"CA\", \"price\" : 12, \"quantity\" : 145, \"cumulativeQuantityForState\" : 427 }\n{ \"_id\" : 5, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 43, \"quantity\" : 134, \"cumulativeQuantityForState\" : 134 }\n{ \"_id\" : 3, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2020-02-08T13:13:23Z\"),\n \"state\" : \"WA\", \"price\" : 13, \"quantity\" : 104, \"cumulativeQuantityForState\" : 238 }\n{ \"_id\" : 1, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2021-03-20T11:30:05Z\"),\n \"state\" : \"WA\", \"price\" : 14, \"quantity\" : 140, \"cumulativeQuantityForState\" : 378 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>, <span class="lg-highlight-string">"cumulativeQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">162</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">120</span>, <span class="lg-highlight-string">"cumulativeQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">282</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">145</span>, <span class="lg-highlight-string">"cumulativeQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">427</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"cumulativeQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">134</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">104</span>, <span class="lg-highlight-string">"cumulativeQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">238</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">140</span>, <span class="lg-highlight-string">"cumulativeQuantityForState"</span> <!-- -->: <span class="lg-highlight-number">378</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Use Documents Window to Obtain Cumulative Quantity for Each Year <a class="headerlink leafygreen-ui-1kepx47" href="#use-documents-window-to-obtain-cumulative-quantity-for-each-year" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-documents-window-to-obtain-cumulative-quantity-for-each-year"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> This example uses a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents" target="_self"> <span> documents </span> </a> window in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> to output the cumulative cake sales <code class="leafygreen-ui-1l06pbn"> quantity </code> for each <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/year/#mongodb-expression-exp.-year"> <code class="leafygreen-ui-1l06pbn"> $year </code> </a> in <code class="leafygreen-ui-1l06pbn"> orderDate </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.aggregate( [\n {\n $setWindowFields: {\n partitionBy: { $year: \"$orderDate\" },\n sortBy: { orderDate: 1 },\n output: {\n cumulativeQuantityForYear: {\n $sum: \"$quantity\",\n window: {\n documents: [ \"unbounded\", \"current\" ]\n }\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <!-- -->{ <span class="lg-highlight-attr">$year</span>: <span class="lg-highlight-string">"$orderDate"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">cumulativeQuantityForYear</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$sum</span>: <span class="lg-highlight-string">"$quantity"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">window</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">documents</span>: <!-- -->[ <span class="lg-highlight-string">"unbounded"</span>, <span class="lg-highlight-string">"current"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> partitionBy: { $year: "$orderDate" } </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-partitionBy" target="_self"> <span> partitions </span> </a> the documents in the collection by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/year/#mongodb-expression-exp.-year"> <code class="leafygreen-ui-1l06pbn"> $year </code> </a> in <code class="leafygreen-ui-1l06pbn"> orderDate </code> . There are are partitions for <code class="leafygreen-ui-1l06pbn"> 2019 </code> , <code class="leafygreen-ui-1l06pbn"> 2020 </code> , and <code class="leafygreen-ui-1l06pbn"> 2021 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sortBy: { orderDate: 1 } </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sorts </span> </a> the documents in each partition by <code class="leafygreen-ui-1l06pbn"> orderDate </code> in ascending order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ), so the earliest <code class="leafygreen-ui-1l06pbn"> orderDate </code> is first. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> output </code> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Sets the <code class="leafygreen-ui-1l06pbn"> cumulativeQuantityForYear </code> field to the cumulative <code class="leafygreen-ui-1l06pbn"> quantity </code> for each year, which increases by successive additions to the previous value in the partition. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Calculates the cumulative <code class="leafygreen-ui-1l06pbn"> quantity </code> using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sum/#mongodb-group-grp.-sum"> <code class="leafygreen-ui-1l06pbn"> $sum </code> </a> operator run in a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents" target="_self"> <span> documents </span> </a> window. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window" target="_self"> <span> window </span> </a> contains documents between an <code class="leafygreen-ui-1l06pbn"> unbounded </code> lower limit and the <code class="leafygreen-ui-1l06pbn"> current </code> document. This means <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sum/#mongodb-group-grp.-sum"> <code class="leafygreen-ui-1l06pbn"> $sum </code> </a> returns the cumulative <code class="leafygreen-ui-1l06pbn"> quantity </code> for the documents between the beginning of the partition and the current document. </p> </li> </ul> </li> </ul> <p class="leafygreen-ui-1kp3ins"> In this example output, the cumulative <code class="leafygreen-ui-1l06pbn"> quantity </code> for each year is shown in the <code class="leafygreen-ui-1l06pbn"> cumulativeQuantityForYear </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 5, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 43, \"quantity\" : 134, \"cumulativeQuantityForYear\" : 134 }\n{ \"_id\" : 4, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-05-18T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 41, \"quantity\" : 162, \"cumulativeQuantityForYear\" : 296 }\n{ \"_id\" : 3, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2020-02-08T13:13:23Z\"),\n \"state\" : \"WA\", \"price\" : 13, \"quantity\" : 104, \"cumulativeQuantityForYear\" : 104 }\n{ \"_id\" : 0, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2020-05-18T14:10:30Z\"),\n \"state\" : \"CA\", \"price\" : 13, \"quantity\" : 120, \"cumulativeQuantityForYear\" : 224 }\n{ \"_id\" : 2, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2021-01-11T06:31:15Z\"),\n \"state\" : \"CA\", \"price\" : 12, \"quantity\" : 145, \"cumulativeQuantityForYear\" : 145 }\n{ \"_id\" : 1, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2021-03-20T11:30:05Z\"),\n \"state\" : \"WA\", \"price\" : 14, \"quantity\" : 140, \"cumulativeQuantityForYear\" : 285 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"cumulativeQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">134</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>, <span class="lg-highlight-string">"cumulativeQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">296</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">104</span>, <span class="lg-highlight-string">"cumulativeQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">104</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">120</span>, <span class="lg-highlight-string">"cumulativeQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">224</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">145</span>, <span class="lg-highlight-string">"cumulativeQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">145</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">140</span>, <span class="lg-highlight-string">"cumulativeQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">285</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Use Documents Window to Obtain Moving Average Quantity for Each Year <a class="headerlink leafygreen-ui-1kepx47" href="#use-documents-window-to-obtain-moving-average-quantity-for-each-year" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-documents-window-to-obtain-moving-average-quantity-for-each-year"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> This example uses a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents" target="_self"> <span> documents </span> </a> window in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> to output the moving average for the cake sales <code class="leafygreen-ui-1l06pbn"> quantity </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.aggregate( [\n {\n $setWindowFields: {\n partitionBy: { $year: \"$orderDate\" },\n sortBy: { orderDate: 1 },\n output: {\n averageQuantity: {\n $avg: \"$quantity\",\n window: {\n documents: [ -1, 0 ]\n }\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <!-- -->{ <span class="lg-highlight-attr">$year</span>: <span class="lg-highlight-string">"$orderDate"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">averageQuantity</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$avg</span>: <span class="lg-highlight-string">"$quantity"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">window</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">documents</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">1</span>, <span class="lg-highlight-number">0</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> partitionBy: "$orderDate" </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-partitionBy" target="_self"> <span> partitions </span> </a> the documents in the collection by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/year/#mongodb-expression-exp.-year"> <code class="leafygreen-ui-1l06pbn"> $year </code> </a> in <code class="leafygreen-ui-1l06pbn"> orderDate </code> . There are are partitions for <code class="leafygreen-ui-1l06pbn"> 2019 </code> , <code class="leafygreen-ui-1l06pbn"> 2020 </code> , and <code class="leafygreen-ui-1l06pbn"> 2021 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sortBy: { orderDate: 1 } </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sorts </span> </a> the documents in each partition by <code class="leafygreen-ui-1l06pbn"> orderDate </code> in ascending order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ), so the earliest <code class="leafygreen-ui-1l06pbn"> orderDate </code> is first. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> output </code> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Sets the <code class="leafygreen-ui-1l06pbn"> averageQuantity </code> field to the moving average <code class="leafygreen-ui-1l06pbn"> quantity </code> for each year. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Calculates the moving average <code class="leafygreen-ui-1l06pbn"> quantity </code> using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/avg/#mongodb-group-grp.-avg"> <code class="leafygreen-ui-1l06pbn"> $avg </code> </a> operator run in a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents" target="_self"> <span> documents </span> </a> window. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window" target="_self"> <span> window </span> </a> contains documents between <code class="leafygreen-ui-1l06pbn"> -1 </code> and <code class="leafygreen-ui-1l06pbn"> 0 </code> . This means <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/avg/#mongodb-group-grp.-avg"> <code class="leafygreen-ui-1l06pbn"> $avg </code> </a> returns the moving average <code class="leafygreen-ui-1l06pbn"> quantity </code> between the document before the current document ( <code class="leafygreen-ui-1l06pbn"> -1 </code> ) and the current document ( <code class="leafygreen-ui-1l06pbn"> 0 </code> ) in the partition. </p> </li> </ul> </li> </ul> <p class="leafygreen-ui-1kp3ins"> In this example output, the moving average <code class="leafygreen-ui-1l06pbn"> quantity </code> is shown in the <code class="leafygreen-ui-1l06pbn"> averageQuantity </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 5, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 43, \"quantity\" : 134, \"averageQuantity\" : 134 }\n{ \"_id\" : 4, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-05-18T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 41, \"quantity\" : 162, \"averageQuantity\" : 148 }\n{ \"_id\" : 3, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2020-02-08T13:13:23Z\"),\n \"state\" : \"WA\", \"price\" : 13, \"quantity\" : 104, \"averageQuantity\" : 104 }\n{ \"_id\" : 0, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2020-05-18T14:10:30Z\"),\n \"state\" : \"CA\", \"price\" : 13, \"quantity\" : 120, \"averageQuantity\" : 112 }\n{ \"_id\" : 2, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2021-01-11T06:31:15Z\"),\n \"state\" : \"CA\", \"price\" : 12, \"quantity\" : 145, \"averageQuantity\" : 145 }\n{ \"_id\" : 1, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2021-03-20T11:30:05Z\"),\n \"state\" : \"WA\", \"price\" : 14, \"quantity\" : 140, \"averageQuantity\" : 142.5 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"averageQuantity"</span> <!-- -->: <span class="lg-highlight-number">134</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>, <span class="lg-highlight-string">"averageQuantity"</span> <!-- -->: <span class="lg-highlight-number">148</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">104</span>, <span class="lg-highlight-string">"averageQuantity"</span> <!-- -->: <span class="lg-highlight-number">104</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">120</span>, <span class="lg-highlight-string">"averageQuantity"</span> <!-- -->: <span class="lg-highlight-number">112</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">145</span>, <span class="lg-highlight-string">"averageQuantity"</span> <!-- -->: <span class="lg-highlight-number">145</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">140</span>, <span class="lg-highlight-string">"averageQuantity"</span> <!-- -->: <span class="lg-highlight-number">142.5</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Use Documents Window to Obtain Cumulative and Maximum Quantity for Each Year <a class="headerlink leafygreen-ui-1kepx47" href="#use-documents-window-to-obtain-cumulative-and-maximum-quantity-for-each-year" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-documents-window-to-obtain-cumulative-and-maximum-quantity-for-each-year"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> This example uses a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents" target="_self"> <span> documents </span> </a> window in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> to output the cumulative and maximum cake sales <code class="leafygreen-ui-1l06pbn"> quantity </code> values for each <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/year/#mongodb-expression-exp.-year"> <code class="leafygreen-ui-1l06pbn"> $year </code> </a> in <code class="leafygreen-ui-1l06pbn"> orderDate </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.aggregate( [\n {\n $setWindowFields: {\n partitionBy: { $year: \"$orderDate\" },\n sortBy: { orderDate: 1 },\n output: {\n cumulativeQuantityForYear: {\n $sum: \"$quantity\",\n window: {\n documents: [ \"unbounded\", \"current\" ]\n }\n },\n maximumQuantityForYear: {\n $max: \"$quantity\",\n window: {\n documents: [ \"unbounded\", \"unbounded\" ]\n }\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <!-- -->{ <span class="lg-highlight-attr">$year</span>: <span class="lg-highlight-string">"$orderDate"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">cumulativeQuantityForYear</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$sum</span>: <span class="lg-highlight-string">"$quantity"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">window</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">documents</span>: <!-- -->[ <span class="lg-highlight-string">"unbounded"</span>, <span class="lg-highlight-string">"current"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">maximumQuantityForYear</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$max</span>: <span class="lg-highlight-string">"$quantity"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">window</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">documents</span>: <!-- -->[ <span class="lg-highlight-string">"unbounded"</span>, <span class="lg-highlight-string">"unbounded"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> partitionBy: "$orderDate" </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-partitionBy" target="_self"> <span> partitions </span> </a> the documents in the collection by <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/year/#mongodb-expression-exp.-year"> <code class="leafygreen-ui-1l06pbn"> $year </code> </a> in <code class="leafygreen-ui-1l06pbn"> orderDate </code> . There are are partitions for <code class="leafygreen-ui-1l06pbn"> 2019 </code> , <code class="leafygreen-ui-1l06pbn"> 2020 </code> , and <code class="leafygreen-ui-1l06pbn"> 2021 </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sortBy: { orderDate: 1 } </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sorts </span> </a> the documents in each partition by <code class="leafygreen-ui-1l06pbn"> orderDate </code> in ascending order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ), so the earliest <code class="leafygreen-ui-1l06pbn"> orderDate </code> is first. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> output </code> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Sets the <code class="leafygreen-ui-1l06pbn"> cumulativeQuantityForYear </code> field to the cumulative <code class="leafygreen-ui-1l06pbn"> quantity </code> for each year. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Calculates the cumulative <code class="leafygreen-ui-1l06pbn"> quantity </code> using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sum/#mongodb-group-grp.-sum"> <code class="leafygreen-ui-1l06pbn"> $sum </code> </a> operator run in a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents" target="_self"> <span> documents </span> </a> window. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window" target="_self"> <span> window </span> </a> contains documents between an <code class="leafygreen-ui-1l06pbn"> unbounded </code> lower limit and the <code class="leafygreen-ui-1l06pbn"> current </code> document. This means <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sum/#mongodb-group-grp.-sum"> <code class="leafygreen-ui-1l06pbn"> $sum </code> </a> returns the cumulative quantity for the documents between the beginning of the partition and the current document. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Sets the <code class="leafygreen-ui-1l06pbn"> maximumQuantityForYear </code> field to the maximum <code class="leafygreen-ui-1l06pbn"> quantity </code> for each year. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Calculates the maximum <code class="leafygreen-ui-1l06pbn"> quantity </code> of all the documents using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/max/#mongodb-group-grp.-max"> <code class="leafygreen-ui-1l06pbn"> $max </code> </a> operator run in a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-documents" target="_self"> <span> documents </span> </a> window. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window" target="_self"> <span> window </span> </a> contains documents between an <code class="leafygreen-ui-1l06pbn"> unbounded </code> lower and <code class="leafygreen-ui-1l06pbn"> upper </code> limit. This means <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/max/#mongodb-group-grp.-max"> <code class="leafygreen-ui-1l06pbn"> $max </code> </a> returns the maximum quantity for the documents in the partition. </p> </li> </ul> </li> </ul> <p class="leafygreen-ui-1kp3ins"> In this example output, the cumulative <code class="leafygreen-ui-1l06pbn"> quantity </code> is shown in the <code class="leafygreen-ui-1l06pbn"> cumulativeQuantityForYear </code> field and the maximum <code class="leafygreen-ui-1l06pbn"> quantity </code> is shown in the <code class="leafygreen-ui-1l06pbn"> maximumQuantityForYear </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 5, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 43, \"quantity\" : 134,\n \"cumulativeQuantityForYear\" : 134, \"maximumQuantityForYear\" : 162 }\n{ \"_id\" : 4, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-05-18T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 41, \"quantity\" : 162,\n \"cumulativeQuantityForYear\" : 296, \"maximumQuantityForYear\" : 162 }\n{ \"_id\" : 3, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2020-02-08T13:13:23Z\"),\n \"state\" : \"WA\", \"price\" : 13, \"quantity\" : 104,\n \"cumulativeQuantityForYear\" : 104, \"maximumQuantityForYear\" : 120 }\n{ \"_id\" : 0, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2020-05-18T14:10:30Z\"),\n \"state\" : \"CA\", \"price\" : 13, \"quantity\" : 120,\n \"cumulativeQuantityForYear\" : 224, \"maximumQuantityForYear\" : 120 }\n{ \"_id\" : 2, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2021-01-11T06:31:15Z\"),\n \"state\" : \"CA\", \"price\" : 12, \"quantity\" : 145,\n \"cumulativeQuantityForYear\" : 145, \"maximumQuantityForYear\" : 145 }\n{ \"_id\" : 1, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2021-03-20T11:30:05Z\"),\n \"state\" : \"WA\", \"price\" : 14, \"quantity\" : 140,\n \"cumulativeQuantityForYear\" : 285, \"maximumQuantityForYear\" : 145 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"cumulativeQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"maximumQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">162</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"cumulativeQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">296</span>, <span class="lg-highlight-string">"maximumQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">162</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">104</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"cumulativeQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">104</span>, <span class="lg-highlight-string">"maximumQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">120</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">120</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"cumulativeQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">224</span>, <span class="lg-highlight-string">"maximumQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">120</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">145</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"cumulativeQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">145</span>, <span class="lg-highlight-string">"maximumQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">145</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">140</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"cumulativeQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">285</span>, <span class="lg-highlight-string">"maximumQuantityForYear"</span> <!-- -->: <span class="lg-highlight-number">145</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-range-window-example"> </span> </section> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Range Window Example <a class="headerlink leafygreen-ui-1kepx47" href="#range-window-example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="range-window-example"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> This example uses a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range" target="_self"> <span> range </span> </a> window in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> to return the sum of the <code class="leafygreen-ui-1l06pbn"> quantity </code> values of cakes sold for orders within plus or minus 10 dollars of the current document's <code class="leafygreen-ui-1l06pbn"> price </code> value: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.aggregate( [\n {\n $setWindowFields: {\n partitionBy: \"$state\",\n sortBy: { price: 1 },\n output: {\n quantityFromSimilarOrders: {\n $sum: \"$quantity\",\n window: {\n range: [ -10, 10 ]\n }\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <span class="lg-highlight-string">"$state"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quantityFromSimilarOrders</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$sum</span>: <span class="lg-highlight-string">"$quantity"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">window</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">range</span>: <!-- -->[ <!-- -->-<span class="lg-highlight-number">10</span>, <span class="lg-highlight-number">10</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> partitionBy: "$state" </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-partitionBy" target="_self"> <span> partitions </span> </a> the documents in the collection by <code class="leafygreen-ui-1l06pbn"> state </code> . There are partitions for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sortBy: { price: 1 } </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sorts </span> </a> the documents in each partition by <code class="leafygreen-ui-1l06pbn"> price </code> in ascending order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ), so the lowest <code class="leafygreen-ui-1l06pbn"> price </code> is first. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> output </code> sets the <code class="leafygreen-ui-1l06pbn"> quantityFromSimilarOrders </code> field to the sum of the <code class="leafygreen-ui-1l06pbn"> quantity </code> values from the documents in a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range" target="_self"> <span> range </span> </a> window. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window" target="_self"> <span> window </span> </a> contains documents between a lower limit of <code class="leafygreen-ui-1l06pbn"> -10 </code> and an upper limit of <code class="leafygreen-ui-1l06pbn"> 10 </code> . The range is inclusive. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sum/#mongodb-group-grp.-sum"> <code class="leafygreen-ui-1l06pbn"> $sum </code> </a> returns the sum of <code class="leafygreen-ui-1l06pbn"> quantity </code> values contained in a range of plus or minus 10 dollars of the current document's <code class="leafygreen-ui-1l06pbn"> price </code> value. </p> </li> </ul> </li> </ul> <p class="leafygreen-ui-1kp3ins"> In this example output, the sum of the <code class="leafygreen-ui-1l06pbn"> quantity </code> values for documents in the window is shown in the <code class="leafygreen-ui-1l06pbn"> quantityFromSimilarOrders </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 2, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2021-01-11T06:31:15Z\"),\n \"state\" : \"CA\", \"price\" : 12, \"quantity\" : 145, \"quantityFromSimilarOrders\" : 265 }\n{ \"_id\" : 0, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2020-05-18T14:10:30Z\"),\n \"state\" : \"CA\", \"price\" : 13, \"quantity\" : 120, \"quantityFromSimilarOrders\" : 265 }\n{ \"_id\" : 4, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-05-18T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 41, \"quantity\" : 162, \"quantityFromSimilarOrders\" : 162 }\n{ \"_id\" : 3, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2020-02-08T13:13:23Z\"),\n \"state\" : \"WA\", \"price\" : 13, \"quantity\" : 104, \"quantityFromSimilarOrders\" : 244 }\n{ \"_id\" : 1, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2021-03-20T11:30:05Z\"),\n \"state\" : \"WA\", \"price\" : 14, \"quantity\" : 140, \"quantityFromSimilarOrders\" : 244 }\n{ \"_id\" : 5, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 43, \"quantity\" : 134, \"quantityFromSimilarOrders\" : 134 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">145</span>, <span class="lg-highlight-string">"quantityFromSimilarOrders"</span> <!-- -->: <span class="lg-highlight-number">265</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">120</span>, <span class="lg-highlight-string">"quantityFromSimilarOrders"</span> <!-- -->: <span class="lg-highlight-number">265</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>, <span class="lg-highlight-string">"quantityFromSimilarOrders"</span> <!-- -->: <span class="lg-highlight-number">162</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">104</span>, <span class="lg-highlight-string">"quantityFromSimilarOrders"</span> <!-- -->: <span class="lg-highlight-number">244</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">140</span>, <span class="lg-highlight-string">"quantityFromSimilarOrders"</span> <!-- -->: <span class="lg-highlight-number">244</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>, <span class="lg-highlight-string">"quantityFromSimilarOrders"</span> <!-- -->: <span class="lg-highlight-number">134</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-setWindowFields-time-range-window-examples"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Time Range Window Examples <a class="headerlink leafygreen-ui-1kepx47" href="#time-range-window-examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="time-range-window-examples"> </div> </a> </h3> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Use a Time Range Window with a Positive Upper Bound <a class="headerlink leafygreen-ui-1kepx47" href="#use-a-time-range-window-with-a-positive-upper-bound" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-a-time-range-window-with-a-positive-upper-bound"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> The following example uses a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window" target="_self"> <span> window </span> </a> with a positive upper bound time range <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-unit" target="_self"> <span> unit </span> </a> in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> . The pipeline outputs an array of <code class="leafygreen-ui-1l06pbn"> orderDate </code> values for each <code class="leafygreen-ui-1l06pbn"> state </code> that match the specified time range. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.aggregate( [\n {\n $setWindowFields: {\n partitionBy: \"$state\",\n sortBy: { orderDate: 1 },\n output: {\n recentOrders: {\n $push: \"$orderDate\",\n window: {\n range: [ \"unbounded\", 10 ],\n unit: \"month\"\n }\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <span class="lg-highlight-string">"$state"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">recentOrders</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$push</span>: <span class="lg-highlight-string">"$orderDate"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">window</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">range</span>: <!-- -->[ <span class="lg-highlight-string">"unbounded"</span>, <span class="lg-highlight-number">10</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">unit</span>: <span class="lg-highlight-string">"month"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> partitionBy: "$state" </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-partitionBy" target="_self"> <span> partitions </span> </a> the documents in the collection by <code class="leafygreen-ui-1l06pbn"> state </code> . There are partitions for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sortBy: { orderDate: 1 } </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sorts </span> </a> the documents in each partition by <code class="leafygreen-ui-1l06pbn"> orderDate </code> in ascending order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ), so the earliest <code class="leafygreen-ui-1l06pbn"> orderDate </code> is first. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> output </code> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Sets the <code class="leafygreen-ui-1l06pbn"> orderDateArrayForState </code> array field to <code class="leafygreen-ui-1l06pbn"> orderDate </code> values for the documents in each <code class="leafygreen-ui-1l06pbn"> state </code> . The array elements are expanded with additions to the previous elements in the array. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/push/#mongodb-group-grp.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> to return an array of <code class="leafygreen-ui-1l06pbn"> orderDate </code> values from the documents in a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range" target="_self"> <span> range </span> </a> window. </p> </li> </ul> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window" target="_self"> <span> window </span> </a> contains documents between an <code class="leafygreen-ui-1l06pbn"> unbounded </code> lower limit and an upper limit set to <code class="leafygreen-ui-1l06pbn"> 10 </code> (10 months after the current document's <code class="leafygreen-ui-1l06pbn"> orderDate </code> value) using a time range <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-unit" target="_self"> <span> unit <!-- --> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/push/#mongodb-group-grp.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> returns the array of <code class="leafygreen-ui-1l06pbn"> orderDate </code> values for the documents between the beginning of the partition and the documents with <code class="leafygreen-ui-1l06pbn"> orderDate </code> values inclusively in a range of the current document's <code class="leafygreen-ui-1l06pbn"> orderDate </code> value plus <code class="leafygreen-ui-1l06pbn"> 10 </code> months. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> In this example output, the array of <code class="leafygreen-ui-1l06pbn"> orderDate </code> values for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> is shown in the <code class="leafygreen-ui-1l06pbn"> recentOrders </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 4, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-05-18T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 41, \"quantity\" : 162,\n \"recentOrders\" : [ ISODate(\"2019-05-18T16:09:01Z\") ] }\n{ \"_id\" : 0, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2020-05-18T14:10:30Z\"),\n \"state\" : \"CA\", \"price\" : 13, \"quantity\" : 120,\n \"recentOrders\" : [ ISODate(\"2019-05-18T16:09:01Z\"), ISODate(\"2020-05-18T14:10:30Z\"), ISODate(\"2021-01-11T06:31:15Z\") ] }\n{ \"_id\" : 2, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2021-01-11T06:31:15Z\"),\n \"state\" : \"CA\", \"price\" : 12, \"quantity\" : 145,\n \"recentOrders\" : [ ISODate(\"2019-05-18T16:09:01Z\"), ISODate(\"2020-05-18T14:10:30Z\"), ISODate(\"2021-01-11T06:31:15Z\") ] }\n{ \"_id\" : 5, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 43, \"quantity\" : 134,\n \"recentOrders\" : [ ISODate(\"2019-01-08T06:12:03Z\") ] }\n{ \"_id\" : 3, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2020-02-08T13:13:23Z\"),\n \"state\" : \"WA\", \"price\" : 13, \"quantity\" : 104,\n \"recentOrders\" : [ ISODate(\"2019-01-08T06:12:03Z\"), ISODate(\"2020-02-08T13:13:23Z\") ] }\n{ \"_id\" : 1, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2021-03-20T11:30:05Z\"),\n \"state\" : \"WA\", \"price\" : 14, \"quantity\" : 140,\n \"recentOrders\" : [ ISODate(\"2019-01-08T06:12:03Z\"), ISODate(\"2020-02-08T13:13:23Z\"), ISODate(\"2021-03-20T11:30:05Z\") ] }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"recentOrders"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>) ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">120</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"recentOrders"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->, <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->, <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>) ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">145</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"recentOrders"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->, <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->, <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>) ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"recentOrders"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>) ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">104</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"recentOrders"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->, <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>) ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">140</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"recentOrders"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->, <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->, <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>) ] }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Use a Time Range Window with a Negative Upper Bound <a class="headerlink leafygreen-ui-1kepx47" href="#use-a-time-range-window-with-a-negative-upper-bound" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-a-time-range-window-with-a-negative-upper-bound"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> The following example uses a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window" target="_self"> <span> window </span> </a> with a negative upper bound time range <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-unit" target="_self"> <span> unit </span> </a> in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-pipeline-pipe.-setWindowFields" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setWindowFields </code> </span> </a> . The pipeline outputs an array of <code class="leafygreen-ui-1l06pbn"> orderDate </code> values for each <code class="leafygreen-ui-1l06pbn"> state </code> that match the specified time range. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cakeSales.aggregate( [\n {\n $setWindowFields: {\n partitionBy: \"$state\",\n sortBy: { orderDate: 1 },\n output: {\n recentOrders: {\n $push: \"$orderDate\",\n window: {\n range: [ \"unbounded\", -10 ],\n unit: \"month\"\n }\n }\n }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cakeSales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$setWindowFields</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">partitionBy</span>: <span class="lg-highlight-string">"$state"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">sortBy</span>: <!-- -->{ <span class="lg-highlight-attr">orderDate</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">output</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">recentOrders</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$push</span>: <span class="lg-highlight-string">"$orderDate"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">window</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">range</span>: <!-- -->[ <span class="lg-highlight-string">"unbounded"</span>, <!-- -->-<span class="lg-highlight-number">10</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">unit</span>: <span class="lg-highlight-string">"month"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> In the example: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> partitionBy: "$state" </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-partitionBy" target="_self"> <span> partitions </span> </a> the documents in the collection by <code class="leafygreen-ui-1l06pbn"> state </code> . There are partitions for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sortBy: { orderDate: 1 } </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-sortBy" target="_self"> <span> sorts </span> </a> the documents in each partition by <code class="leafygreen-ui-1l06pbn"> orderDate </code> in ascending order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ), so the earliest <code class="leafygreen-ui-1l06pbn"> orderDate </code> is first. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> output </code> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Sets the <code class="leafygreen-ui-1l06pbn"> orderDateArrayForState </code> array field to <code class="leafygreen-ui-1l06pbn"> orderDate </code> values for the documents in each <code class="leafygreen-ui-1l06pbn"> state </code> . The array elements are expanded with additions to the previous elements in the array. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/push/#mongodb-group-grp.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> to return an array of <code class="leafygreen-ui-1l06pbn"> orderDate </code> values from the documents in a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-range" target="_self"> <span> range </span> </a> window. </p> </li> </ul> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-window" target="_self"> <span> window </span> </a> contains documents between an <code class="leafygreen-ui-1l06pbn"> unbounded </code> lower limit and an upper limit set to <code class="leafygreen-ui-1l06pbn"> -10 </code> (10 months before the current document's <code class="leafygreen-ui-1l06pbn"> orderDate </code> value) using a time range <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-setWindowFields-unit" target="_self"> <span> unit <!-- --> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/push/#mongodb-group-grp.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> returns the array of <code class="leafygreen-ui-1l06pbn"> orderDate </code> values for the documents between the beginning of the partition and the documents with <code class="leafygreen-ui-1l06pbn"> orderDate </code> values inclusively in a range of the current document's <code class="leafygreen-ui-1l06pbn"> orderDate </code> value minus <code class="leafygreen-ui-1l06pbn"> 10 </code> months. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> In this example output, the array of <code class="leafygreen-ui-1l06pbn"> orderDate </code> values for <code class="leafygreen-ui-1l06pbn"> CA </code> and <code class="leafygreen-ui-1l06pbn"> WA </code> is shown in the <code class="leafygreen-ui-1l06pbn"> recentOrders </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 4, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-05-18T16:09:01Z\"),\n \"state\" : \"CA\", \"price\" : 41, \"quantity\" : 162,\n \"recentOrders\" : [ ] }\n{ \"_id\" : 0, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2020-05-18T14:10:30Z\"),\n \"state\" : \"CA\", \"price\" : 13, \"quantity\" : 120,\n \"recentOrders\" : [ ISODate(\"2019-05-18T16:09:01Z\") ] }\n{ \"_id\" : 2, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2021-01-11T06:31:15Z\"),\n \"state\" : \"CA\", \"price\" : 12, \"quantity\" : 145,\n \"recentOrders\" : [ ISODate(\"2019-05-18T16:09:01Z\") ] }\n{ \"_id\" : 5, \"type\" : \"strawberry\", \"orderDate\" : ISODate(\"2019-01-08T06:12:03Z\"),\n \"state\" : \"WA\", \"price\" : 43, \"quantity\" : 134,\n \"recentOrders\" : [ ] }\n{ \"_id\" : 3, \"type\" : \"vanilla\", \"orderDate\" : ISODate(\"2020-02-08T13:13:23Z\"),\n \"state\" : \"WA\", \"price\" : 13, \"quantity\" : 104,\n \"recentOrders\" : [ ISODate(\"2019-01-08T06:12:03Z\") ] }\n{ \"_id\" : 1, \"type\" : \"chocolate\", \"orderDate\" : ISODate(\"2021-03-20T11:30:05Z\"),\n \"state\" : \"WA\", \"price\" : 14, \"quantity\" : 140,\n \"recentOrders\" : [ ISODate(\"2019-01-08T06:12:03Z\"), ISODate(\"2020-02-08T13:13:23Z\") ] }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">41</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">162</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"recentOrders"</span> <!-- -->: <!-- -->[ <!-- -->] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">0</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-05-18T14:10:30Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">120</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"recentOrders"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>) ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-01-11T06:31:15Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"CA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">12</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">145</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"recentOrders"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-05-18T16:09:01Z"</span>) ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"strawberry"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">43</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">134</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"recentOrders"</span> <!-- -->: <!-- -->[ <!-- -->] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"vanilla"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">13</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">104</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"recentOrders"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>) ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"type"</span> <!-- -->: <span class="lg-highlight-string">"chocolate"</span>, <span class="lg-highlight-string">"orderDate"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2021-03-20T11:30:05Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"state"</span> <!-- -->: <span class="lg-highlight-string">"WA"</span>, <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">14</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">140</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"recentOrders"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2019-01-08T06:12:03Z"</span>)<!-- -->, <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2020-02-08T13:13:23Z"</span>) ] }</td></tr></tbody></table></code></pre> </div> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For an additional example about <span class="leafygreen-ui-vm4wms" tabindex="0"> IOT </span> Power Consumption, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.practical-mongodb-aggregations.com/examples/time-series/iot-power-consumption.html" rel="noopener noreferrer"> <span> Practical MongoDB Aggregations </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> e-book. </p> </div> </div> </section> </section> </section> </section>
https://www.mongodb.com/docs/manual/core/queryable-encryption/about-qe-csfle/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Choosing an In-Use Encryption Approach <a class="headerlink leafygreen-ui-1kepx47" href="#choosing-an-in-use-encryption-approach" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="choosing-an-in-use-encryption-approach"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#about-queryable-encryption-and-csfle" target="_self"> <span> About Queryable Encryption and CSFLE </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#considerations" target="_self"> <span> Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#security-considerations" target="_self"> <span> Security Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#using-queryable-encryption-and-csfle" target="_self"> <span> Using Queryable Encryption and CSFLE </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#querying-encrypted-fields" target="_self"> <span> Querying Encrypted Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#encryption-algorithms" target="_self"> <span> Encryption Algorithms </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#private-querying" target="_self"> <span> Private Querying </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#choosing-between-automatic-and-explicit-encryption" target="_self"> <span> Choosing Between Automatic and Explicit Encryption </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#using-automatic-encryption" target="_self"> <span> Using Automatic Encryption </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#using-explicit-encryption" target="_self"> <span> Using Explicit Encryption </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB provides two approaches to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-In-Use-Encryption"> In-Use Encryption </a> : <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/#std-label-qe-manual-feature-qe"> Queryable Encryption </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/#std-label-manual-csfle-feature"> Client-Side Field Level Encryption </a> (CSFLE). When using either approach, you can also choose between automatic and explicit encryption. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> About Queryable Encryption and CSFLE <a class="headerlink leafygreen-ui-1kepx47" href="#about-queryable-encryption-and-csfle" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="about-queryable-encryption-and-csfle"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Both Queryable Encryption and Client-Side Field Level Encryption (CSFLE) enable a client application to encrypt data before transporting it over the network. Sensitive data is transparently encrypted and decrypted by the client and only communicated to and from the server in encrypted form. </p> <p class="leafygreen-ui-1kp3ins"> To compare features in detail, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/features/#std-label-qe-features"> Queryable Encryption Features </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/features/#std-label-csfle-features"> CSFLE Features <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#considerations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="considerations"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> When implementing an application that uses Queryable Encryption or CSFLE, review the security considerations in this section. </p> <p class="leafygreen-ui-1kp3ins"> For the limitations of each approach, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/limitations/#std-label-qe-reference-encryption-limits"> Queryable Encryption limitations </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/reference/limitations/#std-label-csfle-reference-encryption-limits"> CSFLE limitations <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB server and driver version compatibility, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/compatibility/#std-label-qe-csfle-compatibility"> Compatibility <!-- --> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-qe-csfle-security-considerations"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Security Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#security-considerations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="security-considerations"> </div> </a> </h3> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> CSFLE and Queryable Encryption do not provide any guarantees against adversaries with access to your Customer Master Key and Data Encryption Keys. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> CSFLE and Queryable Encryption do not provide any guarantees against adversaries with arbitrary write access to collections containing encrypted data. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MongoDB uses <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/schema-validation/#std-label-schema-validation-overview"> schema validation </a> to enforce encryption of specific fields in a collection. Without a client-side schema, the client downloads the server-side schema for the collection to determine which fields to encrypt. To avoid this issue, use client-side schema validation. </p> <p class="leafygreen-ui-1kp3ins"> Because CSFLE and Queryable Encryption do not provide a mechanism to verify the integrity of a schema, relying on a server-side schema means trusting that the server's schema has not been tampered with. If an adversary compromises the server, they can modify the schema so that a previously encrypted field is no longer labeled for encryption. This causes the client to send plaintext values for that field. </p> <p class="leafygreen-ui-1kp3ins"> For an example of CSFLE configuration for client and server-side schemas, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/fundamentals/automatic-encryption/#std-label-field-level-encryption-automatic-remote-schema"> CSFLE Server-Side Field Level Encryption Enforcement <!-- --> . </a> </p> </li> </ul> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Using Queryable Encryption and CSFLE <a class="headerlink leafygreen-ui-1kepx47" href="#using-queryable-encryption-and-csfle" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="using-queryable-encryption-and-csfle"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can use Queryable Encryption, Client-Side Field Level Encryption, or both in your application. However, you can't use both approaches in the same collection. </p> <p class="leafygreen-ui-1kp3ins"> Consider using Queryable Encryption in the following scenarios: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You are developing a new application and want to use the latest cryptographic advancements from MongoDB. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You expect users to run ranged, prefix, suffix, or substring queries against encrypted data. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your application can use a single key for a given field, rather than requiring separate keys on a per-user or per-tenant basis. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> There are situations where CSFLE may be a preferable solution: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Your application already uses CSFLE. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You need to use different keys for the same field. This is commonly encountered when separating tenants or using user-specific keys. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You need to be flexible with your data schema and potentially add more encrypted fields. Adding encrypted fields for Queryable Encryption requires rebuilding metadata collections and indexes. </p> </li> </ul> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Querying Encrypted Fields <a class="headerlink leafygreen-ui-1kepx47" href="#querying-encrypted-fields" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="querying-encrypted-fields"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption supports equality and range queries on encrypted fields. Support for prefix, suffix, and substring queries with Queryable Encryption is under development. </p> <p class="leafygreen-ui-1kp3ins"> Client-Side Field Level Encryption supports equality queries on deterministically encrypted fields. </p> <p class="leafygreen-ui-1kp3ins"> For more information about supported query operators, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/supported-operations/#std-label-qe-supported-query-operators"> Supported Query Operators for Queryable Encryption </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/reference/supported-operations/#std-label-csfle-supported-query-operators"> Supported Query Operators for CSFLE </a> . For the full list of MongoDB query operators, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/#std-label-query-projection-operators-top"> Query and Projection Operators <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Encryption Algorithms <a class="headerlink leafygreen-ui-1kepx47" href="#encryption-algorithms" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="encryption-algorithms"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The new encryption algorithm for Queryable Encryption uses randomized encryption based on structured encryption, which produces different encrypted output values from the same input. </p> <p class="leafygreen-ui-1kp3ins"> For detailed information on MongoDB's approach to Queryable Encryption, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://cdn.bfldr.com/2URK6TO/as/64kp46t53v34xw37gkngbrg/An_Overview_of_Queryable_Encryption" rel="noopener noreferrer"> <span> Overview of Queryable Encryption </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://cdn.bfldr.com/2URK6TO/as/jkwp857q2zr8fj5vqs24f5/Design__Analysis_Stateless_Document_Database_Encryption_Scheme" rel="noopener noreferrer"> <span> Design and Analysis of a Stateless Document Database Encryption Scheme </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> whitepapers. </p> <p class="leafygreen-ui-1kp3ins"> The CSFLE encryption algorithm supports both randomized encryption and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/fundamentals/encryption-algorithms/#std-label-csfle-deterministic-encryption"> deterministic encryption </a> . However, it only supports <strong> querying </strong> fields that are encrypted deterministically. With deterministic encryption, a given input value always encrypts to the same output value. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Private Querying <a class="headerlink leafygreen-ui-1kepx47" href="#private-querying" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="private-querying"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB encrypts queries for both Queryable Encryption and Client-Side Field Level Encryption so that the server has no information on cleartext document or query values. With Queryable Encryption, private querying goes a step further and redacts logs and metadata to scrub information around the query's existence. This ensures stronger privacy and confidentiality. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Choosing Between Automatic and Explicit Encryption <a class="headerlink leafygreen-ui-1kepx47" href="#choosing-between-automatic-and-explicit-encryption" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="choosing-between-automatic-and-explicit-encryption"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Using Automatic Encryption <a class="headerlink leafygreen-ui-1kepx47" href="#using-automatic-encryption" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="using-automatic-encryption"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> We recommend automatic encryption in most situations, as it streamlines the process of writing your client application. With automatic encryption, MongoDB automatically encrypts and decrypts fields in read and write operations. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Using Explicit Encryption <a class="headerlink leafygreen-ui-1kepx47" href="#using-explicit-encryption" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="using-explicit-encryption"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Explicit encryption provides fine-grained control over security, at the cost of increased complexity when configuring collections and writing code for MongoDB Drivers. With explicit encryption, you specify how to encrypt fields in your document for each operation you perform on the database, and you include this logic throughout your application. </p> <p class="leafygreen-ui-1kp3ins"> For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/manual-encryption/#std-label-qe-fundamentals-manual-encryption"> Explicit Encryption with Queryable Encryption </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/fundamentals/manual-encryption/#std-label-csfle-fundamentals-manual-encryption"> Explicit Encryption with CSFLE <!-- --> . </a> </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/sp.processor.stats/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> sp.processor.stats() <a class="headerlink leafygreen-ui-1kepx47" href="#sp.processor.stats--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sp.processor.stats--"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#command-fields" target="_self"> <span> Command Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#access-control" target="_self"> <span> Access Control </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self"> <span> Learn More </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> sp.processor.stats() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-sp.processor.stats" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-sp.processor.stats"> </div> </a> </dt> <dd> </dd> </dl> <div> <p> <em> New <!-- --> in version <!-- --> 7.0 </em> : <!-- --> Returns a document containing statistics of a currently running <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-sp/overview/#mongodb-expression-exp.Stream-Processor" target="_self"> <span> Stream Processor </span> </a> on the current <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-sp/overview/#mongodb-expression-exp.Stream-Processing-Instance" target="_self"> <span> Stream Processing Instance <!-- --> . </span> </a> </p> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-sp.processor.stats" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> sp.processor.stats() </code> </span> </a> method has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sp.processor.stats()","programmingLanguage":"JSON"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sp.processor.stats()</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Command Fields <a class="headerlink leafygreen-ui-1kepx47" href="#command-fields" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="command-fields"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sp.processor.stats() </code> takes these fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:20%"/> <col style="width:40%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Necessity </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> options </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> object </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Object defining various optional settings for your statistics report. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> options.scale </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> integer </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Unit to use for the size of items described in the output. If set to <code class="leafygreen-ui-1l06pbn"> 1024 </code> , the output document shows sizes in kibibytes. Defaults to bytes. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> verbose </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Flag that specifies the verbosity level of the output document. If set to <code class="leafygreen-ui-1l06pbn"> true </code> , the output document contains a subdocument that reports the statistics of each individual operator in your pipeline. Defaults to false. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> sp.processor.stats() </code> returns a document containing statistics about the specified stream processor to <code class="leafygreen-ui-1l06pbn"> STDOUT </code> . These statistics include but are not limited to: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The number of messages ingested and processed </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The total size of all input and output </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The amount of memory used to store processor state </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> You can only invoke <code class="leafygreen-ui-1l06pbn"> sp.processor.stats() </code> on a currently running stream processor. If you try to invoke this command on a stopped stream processor, <code class="leafygreen-ui-1l06pbn"> mongosh </code> will return an error. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Access Control <a class="headerlink leafygreen-ui-1kepx47" href="#access-control" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="access-control"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The user running <code class="leafygreen-ui-1l06pbn"> sp.processor.stats() </code> must have the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/mongodb-users-roles-and-privileges/#mongodb-atlasrole-atlasAdmin" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> atlasAdmin </code> </span> </a> role. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example shows an expected response from calling <code class="leafygreen-ui-1l06pbn"> sp.solarDemo.stats() </code> to get the statistics of a stream processor called <code class="leafygreen-ui-1l06pbn"> solarDemo </code> : </p> <div class="css-1f5771r"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sp.solarDemo.stats()","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sp.solarDemo.stats()</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="css-9st569 efa38qy0" style="--border-color:#E8EDEB"> <button aria-disabled="false" class="lg-ui-button-0000 leafygreen-ui-hix6y6" data-lgid="lg-button" role="button" type="button"> <div class="leafygreen-ui-v038xi"> </div> <div class="leafygreen-ui-16tr4y"> <svg alt="" aria-hidden="true" class="leafygreen-ui-hjnzs9" fill="none" height="16" role="presentation" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"> <path clip-rule="evenodd" d="M14.364 10.778a1 1 0 0 0 0-1.414l-4.95-4.95-.707-.707a1 1 0 0 0-1.414 0l-.707.707-4.95 4.95a1 1 0 0 0 0 1.414l.707.707a1 1 0 0 0 1.414 0L8 7.243l4.243 4.242a1 1 0 0 0 1.414 0l.707-.707Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> HIDE OUTPUT </div> </button> </div> <div class="leafygreen-ui-1oteowz"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n ok: 1,\n ns: '6500aa277fdbdb6e443a992e.63c1928d768e39423386aa16.solarDemo',\n stats: {\n name: 'solarDemo',\n processorId: '65f9fea5c5154385174af71e',\n status: 'running',\n scaleFactor: Long('1'),\n inputMessageCount: Long('926'),\n inputMessageSize: 410310,\n outputMessageCount: Long('383'),\n outputMessageSize: 425513,\n dlqMessageCount: Long('0'),\n dlqMessageSize: Long('0'),\n stateSize: Long('4504'),\n watermark: ISODate('2024-03-19T22:16:49.523Z'),\n ok: 1\n },\n pipeline: [\n {\n '$source': {\n connectionName: 'sample_stream_solar',\n timeField: { '$dateFromString': { dateString: '$timestamp' } }\n }\n },\n {\n '$match': { '$expr': { '$ne': [ '$device_id', 'device_8' ] } }\n },\n {\n '$tumblingWindow': {\n interval: { size: 10, unit: 'second' },\n pipeline: [\n {\n '$group': {\n _id: [Object],\n max_temp: [Object],\n max_watts: [Object],\n min_watts: [Object],\n avg_watts: [Object],\n median_watts: [Object]\n }\n }\n ]\n }\n },\n {\n '$merge': {\n into: {\n connectionName: 'mongodb1',\n db: 'solar_db',\n coll: 'solar_coll'\n },\n on: [ '_id' ]\n }\n }\n ]\n}","programmingLanguage":"JSON"} </script> <div class="css-1sax7hu e11q6jfk0" style="--code-container-border:initial;--code-pre-border:none"> <div class="leafygreen-ui-1fyvhqe"> <div class="leafygreen-ui-1ij019s"> <pre class="leafygreen-ui-12cejcz" tabindex="0"><code class="lg-highlight-hljs-dark json leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ok<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">1</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ns<span class="lg-highlight-punctuation">:</span> '<span class="lg-highlight-number">6500</span>aa277fdbdb6e443a992e<span class="lg-highlight-number">.63</span>c1928d768e39423386aa16.solarDemo'<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> stats<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> name<span class="lg-highlight-punctuation">:</span> 'solarDemo'<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> processorId<span class="lg-highlight-punctuation">:</span> '<span class="lg-highlight-number">65</span>f9fea5c5154385174af71e'<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> status<span class="lg-highlight-punctuation">:</span> 'running'<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> scaleFactor<span class="lg-highlight-punctuation">:</span> Long('<span class="lg-highlight-number">1</span>')<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> inputMessageCount<span class="lg-highlight-punctuation">:</span> Long('<span class="lg-highlight-number">926</span>')<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> inputMessageSize<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">410310</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> outputMessageCount<span class="lg-highlight-punctuation">:</span> Long('<span class="lg-highlight-number">383</span>')<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> outputMessageSize<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">425513</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> dlqMessageCount<span class="lg-highlight-punctuation">:</span> Long('<span class="lg-highlight-number">0</span>')<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> dlqMessageSize<span class="lg-highlight-punctuation">:</span> Long('<span class="lg-highlight-number">0</span>')<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> stateSize<span class="lg-highlight-punctuation">:</span> Long('<span class="lg-highlight-number">4504</span>')<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> watermark<span class="lg-highlight-punctuation">:</span> ISODate('<span class="lg-highlight-number">2024</span><span class="lg-highlight-number">-03</span><span class="lg-highlight-number">-19</span>T22<span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">16</span><span class="lg-highlight-punctuation">:</span><span class="lg-highlight-number">49.523</span>Z')<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ok<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> pipeline<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> '$source'<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> connectionName<span class="lg-highlight-punctuation">:</span> 'sample_stream_solar'<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> timeField<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span> '$dateFromString'<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span> dateString<span class="lg-highlight-punctuation">:</span> '$timestamp' <span class="lg-highlight-punctuation">}</span> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> '$match'<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span> '$expr'<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span> '$ne'<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span> '$device_id'<span class="lg-highlight-punctuation">,</span> 'device_8' <span class="lg-highlight-punctuation">]</span> <span class="lg-highlight-punctuation">}</span> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> '$tumblingWindow'<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> interval<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span> size<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-number">10</span><span class="lg-highlight-punctuation">,</span> unit<span class="lg-highlight-punctuation">:</span> 'second' <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> pipeline<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> '$group'<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> _id<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span>Object<span class="lg-highlight-punctuation">]</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> max_temp<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span>Object<span class="lg-highlight-punctuation">]</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> max_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span>Object<span class="lg-highlight-punctuation">]</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> min_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span>Object<span class="lg-highlight-punctuation">]</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> avg_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span>Object<span class="lg-highlight-punctuation">]</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> median_watts<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span>Object<span class="lg-highlight-punctuation">]</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">]</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> '$merge'<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> into<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">{</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> connectionName<span class="lg-highlight-punctuation">:</span> 'mongodb1'<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> db<span class="lg-highlight-punctuation">:</span> 'solar_db'<span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> coll<span class="lg-highlight-punctuation">:</span> 'solar_coll'</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span><span class="lg-highlight-punctuation">,</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> on<span class="lg-highlight-punctuation">:</span> <span class="lg-highlight-punctuation">[</span> '_id' <span class="lg-highlight-punctuation">]</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">}</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-punctuation">]</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-punctuation">}</span></td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-sp/manage-stream-processor/" target="_self"> <span> Manage Stream Processors </span> </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> <code class="leafygreen-ui-1l06pbn"> mongosh </code> Methods <a class="headerlink leafygreen-ui-1kepx47" href="#mongosh-methods" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongosh-methods"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#atlas-search-index-methods" target="_self"> <span> Atlas Search Index Methods </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#atlas-stream-processing-methods" target="_self"> <span> Atlas Stream Processing Methods </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#collection" target="_self"> <span> Collection </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#cursor" target="_self"> <span> Cursor </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#database" target="_self"> <span> Database </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#query-plan-cache" target="_self"> <span> Query Plan Cache </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#bulk-write-operation" target="_self"> <span> Bulk Write Operation </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#user-management" target="_self"> <span> User Management </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#role-management" target="_self"> <span> Role Management </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#replication" target="_self"> <span> Replication </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#sharding" target="_self"> <span> Sharding </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#constructors" target="_self"> <span> Constructors </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#connection" target="_self"> <span> Connection </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#client-side-field-level-encryption" target="_self"> <span> Client-Side Field Level Encryption </span> </a> </li> </ul> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> JavaScript in MongoDB </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Although these methods use JavaScript, most interactions with MongoDB do not use JavaScript but use an <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> idiomatic driver </span> </a> in the language of the interacting application. </p> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For details on a specific method, including syntax and examples, click on the link to the method's reference page. </p> </div> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Atlas Search Index Methods <a class="headerlink leafygreen-ui-1kepx47" href="#atlas-search-index-methods" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="atlas-search-index-methods"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/atlas-search-overview/#fts-indexes" target="_self"> <span> Atlas Search indexes </span> </a> let you query data in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/" target="_self"> <span> Atlas Search </span> </a> . Atlas Search indexes enable performant text search queries by mapping search terms to the documents that contain those terms. </p> <p class="leafygreen-ui-1kp3ins"> Use the following methods to manage Atlas Search indexes. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createSearchIndex/#mongodb-method-db.collection.createSearchIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.createSearchIndex() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Creates an <!-- --> Atlas Search index <!-- --> on a specified collection. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.dropSearchIndex/#mongodb-method-db.collection.dropSearchIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.dropSearchIndex() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Deletes an existing <!-- --> Atlas Search index <!-- --> . </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.getSearchIndexes/#mongodb-method-db.collection.getSearchIndexes"> <code class="leafygreen-ui-1l06pbn"> db.collection.getSearchIndexes() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Returns information about existing <!-- --> Atlas Search indexes <!-- --> on a specified collection. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateSearchIndex/#mongodb-method-db.collection.updateSearchIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.updateSearchIndex() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Updates an existing <!-- --> Atlas Search index <!-- --> . </p> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Atlas Stream Processing Methods <a class="headerlink leafygreen-ui-1kepx47" href="#atlas-stream-processing-methods" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="atlas-stream-processing-methods"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-sp/overview/#mongodb-expression-exp.Stream-Processor" target="_self"> <span> Atlas Stream Processors </span> </a> let you perform aggregation operations against streams of continuous data using the same data model and query API that you use with at-rest data. </p> <p class="leafygreen-ui-1kp3ins"> Use the following methods to manage Stream Processors: </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The following methods can only be run on deployments hosted on <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/" target="_self"> <span> MongoDB Atlas <!-- --> . </span> </a> </p> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sp.createStreamProcessor/#mongodb-method-sp.createStreamProcessor"> <code class="leafygreen-ui-1l06pbn"> sp.createStreamProcessor() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a stream processor. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sp.listStreamProcessors/#mongodb-method-sp.listStreamProcessors"> <code class="leafygreen-ui-1l06pbn"> sp.listStreamProcessors() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Lists all existing stream processors on the current stream processing instance. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sp.process/#mongodb-method-sp.process"> <code class="leafygreen-ui-1l06pbn"> sp.process() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates an ephemeral stream processor. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sp.processor.drop/#mongodb-method-sp.processor.drop"> <code class="leafygreen-ui-1l06pbn"> sp.processor.drop() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deletes an existing stream processor. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sp.processor.sample/#mongodb-method-sp.processor.sample"> <code class="leafygreen-ui-1l06pbn"> sp.processor.sample() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns an array of sampled results from a currently running stream processor. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sp.processor.start/#mongodb-method-sp.processor.start"> <code class="leafygreen-ui-1l06pbn"> sp.processor.start() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Starts an existing stream processor. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sp.processor.stats/#mongodb-method-sp.processor.stats"> <code class="leafygreen-ui-1l06pbn"> sp.processor.stats() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns statistics summarizing an existing stream processor. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sp.processor.stop/#mongodb-method-sp.processor.stop"> <code class="leafygreen-ui-1l06pbn"> sp.processor.stop() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Stops a currently running stream processor. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Collection <a class="headerlink leafygreen-ui-1kepx47" href="#collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="collection"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.analyzeShardKey/#mongodb-method-db.collection.analyzeShardKey"> <code class="leafygreen-ui-1l06pbn"> db.collection.analyzeShardKey() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Calculates metrics for evaluating a shard key. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.aggregate/#mongodb-method-db.collection.aggregate"> <code class="leafygreen-ui-1l06pbn"> db.collection.aggregate() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Provides access to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/aggregation-pipeline/#std-label-aggregation-pipeline"> aggregation pipeline <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.bulkWrite/#mongodb-method-db.collection.bulkWrite"> <code class="leafygreen-ui-1l06pbn"> db.collection.bulkWrite() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Provides bulk write operation functionality. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.compactStructuredEncryptionData/#mongodb-method-db.collection.compactStructuredEncryptionData"> <code class="leafygreen-ui-1l06pbn"> db.collection.compactStructuredEncryptionData() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/compactStructuredEncryptionData/#mongodb-dbcommand-dbcmd.compactStructuredEncryptionData"> <code class="leafygreen-ui-1l06pbn"> compactStructuredEncryptionData </code> </a> to return a success or failure object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.configureQueryAnalyzer/#mongodb-method-db.collection.configureQueryAnalyzer"> <code class="leafygreen-ui-1l06pbn"> db.collection.configureQueryAnalyzer() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Configures query sampling for a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.count/#mongodb-method-db.collection.count"> <code class="leafygreen-ui-1l06pbn"> db.collection.count() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/count/#mongodb-dbcommand-dbcmd.count"> <code class="leafygreen-ui-1l06pbn"> count </code> </a> to return a count of the number of documents in a collection or a view. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.countDocuments/#mongodb-method-db.collection.countDocuments"> <code class="leafygreen-ui-1l06pbn"> db.collection.countDocuments() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Wraps the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> aggregation stage with a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sum/#mongodb-group-grp.-sum"> <code class="leafygreen-ui-1l06pbn"> $sum </code> </a> expression to return a count of the number of documents in a collection or a view. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndex() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Builds an index on a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndexes/#mongodb-method-db.collection.createIndexes"> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndexes() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Builds one or more indexes on a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.dataSize/#mongodb-method-db.collection.dataSize"> <code class="leafygreen-ui-1l06pbn"> db.collection.dataSize() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the size of the collection. Wraps the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collStats/#mongodb-data-collStats.size"> <code class="leafygreen-ui-1l06pbn"> size </code> </a> field in the output of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collStats/#mongodb-dbcommand-dbcmd.collStats"> <code class="leafygreen-ui-1l06pbn"> collStats </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.deleteOne/#mongodb-method-db.collection.deleteOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.deleteOne() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deletes a single document in a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.deleteMany/#mongodb-method-db.collection.deleteMany"> <code class="leafygreen-ui-1l06pbn"> db.collection.deleteMany() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deletes multiple documents in a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.distinct/#mongodb-method-db.collection.distinct"> <code class="leafygreen-ui-1l06pbn"> db.collection.distinct() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns an array of documents that have distinct values for the specified field. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.drop/#mongodb-method-db.collection.drop"> <code class="leafygreen-ui-1l06pbn"> db.collection.drop() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes the specified collection from the database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.dropIndex/#mongodb-method-db.collection.dropIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndex() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes a specified index on a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.dropIndexes/#mongodb-method-db.collection.dropIndexes"> <code class="leafygreen-ui-1l06pbn"> db.collection.dropIndexes() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes all indexes on a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.ensureIndex/#mongodb-method-db.collection.ensureIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.ensureIndex() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removed. Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndex() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.estimatedDocumentCount/#mongodb-method-db.collection.estimatedDocumentCount"> <code class="leafygreen-ui-1l06pbn"> db.collection.estimatedDocumentCount() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/count/#mongodb-dbcommand-dbcmd.count"> <code class="leafygreen-ui-1l06pbn"> count </code> </a> to return an approximate count of the documents in a collection or a view. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.explain/#mongodb-method-db.collection.explain"> <code class="leafygreen-ui-1l06pbn"> db.collection.explain() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns information on the query execution of various methods. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> db.collection.find() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Performs a query on a collection or a view and returns a cursor object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findAndModify/#mongodb-method-db.collection.findAndModify"> <code class="leafygreen-ui-1l06pbn"> db.collection.findAndModify() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Atomically modifies and returns a single document. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findOne/#mongodb-method-db.collection.findOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.findOne() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Performs a query and returns a single document. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findOneAndDelete/#mongodb-method-db.collection.findOneAndDelete"> <code class="leafygreen-ui-1l06pbn"> db.collection.findOneAndDelete() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Finds a single document and deletes it. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findOneAndReplace/#mongodb-method-db.collection.findOneAndReplace"> <code class="leafygreen-ui-1l06pbn"> db.collection.findOneAndReplace() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Finds a single document and replaces it. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findOneAndUpdate/#mongodb-method-db.collection.findOneAndUpdate"> <code class="leafygreen-ui-1l06pbn"> db.collection.findOneAndUpdate() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Finds a single document and updates it. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.getIndexes/#mongodb-method-db.collection.getIndexes"> <code class="leafygreen-ui-1l06pbn"> db.collection.getIndexes() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns an array of documents that describe the existing indexes on a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.getShardDistribution/#mongodb-method-db.collection.getShardDistribution"> <code class="leafygreen-ui-1l06pbn"> db.collection.getShardDistribution() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> For collections in sharded clusters, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.getShardDistribution/#mongodb-method-db.collection.getShardDistribution"> <code class="leafygreen-ui-1l06pbn"> db.collection.getShardDistribution() </code> </a> reports data of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-chunk"> chunk </a> distribution. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.getShardVersion/#mongodb-method-db.collection.getShardVersion"> <code class="leafygreen-ui-1l06pbn"> db.collection.getShardVersion() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Internal diagnostic method for sharded cluster. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.hideIndex/#mongodb-method-db.collection.hideIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.hideIndex() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Hides an index from the query planner. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.insertOne/#mongodb-method-db.collection.insertOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.insertOne() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Inserts a new document into a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.insertMany/#mongodb-method-db.collection.insertMany"> <code class="leafygreen-ui-1l06pbn"> db.collection.insertMany() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Inserts several new documents into a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.isCapped/#mongodb-method-db.collection.isCapped"> <code class="leafygreen-ui-1l06pbn"> db.collection.isCapped() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Reports if a collection is a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-capped-collection"> capped collection <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.latencyStats/#mongodb-method-db.collection.latencyStats"> <code class="leafygreen-ui-1l06pbn"> db.collection.latencyStats() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns latency statistics for a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.mapReduce/#mongodb-method-db.collection.mapReduce"> <code class="leafygreen-ui-1l06pbn"> db.collection.mapReduce() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Performs map-reduce style data aggregation. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.reIndex/#mongodb-method-db.collection.reIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.reIndex() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Rebuilds all existing indexes on a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.remove/#mongodb-method-db.collection.remove"> <code class="leafygreen-ui-1l06pbn"> db.collection.remove() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deletes documents from a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.renameCollection/#mongodb-method-db.collection.renameCollection"> <code class="leafygreen-ui-1l06pbn"> db.collection.renameCollection() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Changes the name of a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.replaceOne/#mongodb-method-db.collection.replaceOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.replaceOne() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Replaces a single document in a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.stats/#mongodb-method-db.collection.stats"> <code class="leafygreen-ui-1l06pbn"> db.collection.stats() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Reports on the state of a collection. Provides a wrapper around the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collStats/#mongodb-dbcommand-dbcmd.collStats"> <code class="leafygreen-ui-1l06pbn"> collStats </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.storageSize/#mongodb-method-db.collection.storageSize"> <code class="leafygreen-ui-1l06pbn"> db.collection.storageSize() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Reports the total size used by the collection in bytes. Provides a wrapper around the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collStats/#mongodb-data-collStats.storageSize"> <code class="leafygreen-ui-1l06pbn"> storageSize </code> </a> field of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collStats/#mongodb-dbcommand-dbcmd.collStats"> <code class="leafygreen-ui-1l06pbn"> collStats </code> </a> output. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.totalIndexSize/#mongodb-method-db.collection.totalIndexSize"> <code class="leafygreen-ui-1l06pbn"> db.collection.totalIndexSize() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Reports the total size used by the indexes on a collection. Provides a wrapper around the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collStats/#mongodb-data-collStats.totalIndexSize"> <code class="leafygreen-ui-1l06pbn"> totalIndexSize </code> </a> field of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collStats/#mongodb-dbcommand-dbcmd.collStats"> <code class="leafygreen-ui-1l06pbn"> collStats </code> </a> output. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.totalSize/#mongodb-method-db.collection.totalSize"> <code class="leafygreen-ui-1l06pbn"> db.collection.totalSize() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Reports the total size of a collection, including the size of all documents and all indexes on a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.unhideIndex/#mongodb-method-db.collection.unhideIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.unhideIndex() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Unhides an index from the query planner. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#mongodb-method-db.collection.updateOne"> <code class="leafygreen-ui-1l06pbn"> db.collection.updateOne() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Modifies a single document in a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateMany/#mongodb-method-db.collection.updateMany"> <code class="leafygreen-ui-1l06pbn"> db.collection.updateMany() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Modifies multiple documents in a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.watch/#mongodb-method-db.collection.watch"> <code class="leafygreen-ui-1l06pbn"> db.collection.watch() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Establishes a Change Stream on a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.validate/#mongodb-method-db.collection.validate"> <code class="leafygreen-ui-1l06pbn"> db.collection.validate() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Performs diagnostic operations on a collection. </div> </div> </td> </tr> </tbody> </table> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-js-query-cursor-methods"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Cursor <a class="headerlink leafygreen-ui-1kepx47" href="#cursor" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="cursor"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.addOption/#mongodb-method-cursor.addOption"> <code class="leafygreen-ui-1l06pbn"> cursor.addOption() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds special wire protocol flags that modify the behavior of the query.' </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.allowDiskUse/#mongodb-method-cursor.allowDiskUse"> <code class="leafygreen-ui-1l06pbn"> cursor.allowDiskUse() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Allows MongoDB to use temporary files on disk to store data exceeding the 100 megabyte system memory limit while processing a blocking sort operation. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.allowPartialResults/#mongodb-method-cursor.allowPartialResults"> <code class="leafygreen-ui-1l06pbn"> cursor.allowPartialResults() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Allows <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> db.collection.find() </code> </a> operations against a sharded collection to return partial results, rather than an error, if one or more queried shards are unavailable. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.batchSize/#mongodb-method-cursor.batchSize"> <code class="leafygreen-ui-1l06pbn"> cursor.batchSize() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Controls the number of documents MongoDB will return to the client in a single network message. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.close/#mongodb-method-cursor.close"> <code class="leafygreen-ui-1l06pbn"> cursor.close() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Close a cursor and free associated server resources. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.isClosed/#mongodb-method-cursor.isClosed"> <code class="leafygreen-ui-1l06pbn"> cursor.isClosed() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns <code class="leafygreen-ui-1l06pbn"> true </code> if the cursor is closed. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.collation/#mongodb-method-cursor.collation"> <code class="leafygreen-ui-1l06pbn"> cursor.collation() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the collation for the cursor returned by the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> db.collection.find() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.comment/#mongodb-method-cursor.comment"> <code class="leafygreen-ui-1l06pbn"> cursor.comment() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Attaches a comment to the query to allow for traceability in the logs and the system.profile collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.count/#mongodb-method-cursor.count"> <code class="leafygreen-ui-1l06pbn"> cursor.count() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Modifies the cursor to return the number of documents in the result set rather than the documents themselves. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.explain/#mongodb-method-cursor.explain"> <code class="leafygreen-ui-1l06pbn"> cursor.explain() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Reports on the query execution plan for a cursor. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.forEach/#mongodb-method-cursor.forEach"> <code class="leafygreen-ui-1l06pbn"> cursor.forEach() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Applies a JavaScript function for every document in a cursor. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.hasNext/#mongodb-method-cursor.hasNext"> <code class="leafygreen-ui-1l06pbn"> cursor.hasNext() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns true if the cursor has documents and can be iterated. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.hint/#mongodb-method-cursor.hint"> <code class="leafygreen-ui-1l06pbn"> cursor.hint() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Forces MongoDB to use a specific index for a query. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.isExhausted/#mongodb-method-cursor.isExhausted"> <code class="leafygreen-ui-1l06pbn"> cursor.isExhausted() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns <code class="leafygreen-ui-1l06pbn"> true </code> if the cursor is closed <em> and </em> there are no objects remaining in the batch. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.itcount/#mongodb-method-cursor.itcount"> <code class="leafygreen-ui-1l06pbn"> cursor.itcount() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Computes the total number of documents in the cursor client-side by fetching and iterating the result set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.limit/#mongodb-method-cursor.limit"> <code class="leafygreen-ui-1l06pbn"> cursor.limit() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Constrains the size of a cursor's result set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.map/#mongodb-method-cursor.map"> <code class="leafygreen-ui-1l06pbn"> cursor.map() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Applies a function to each document in a cursor and collects the return values in an array. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.max/#mongodb-method-cursor.max"> <code class="leafygreen-ui-1l06pbn"> cursor.max() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies an exclusive upper index bound for a cursor. For use with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.hint/#mongodb-method-cursor.hint"> <code class="leafygreen-ui-1l06pbn"> cursor.hint() </code> </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.maxTimeMS/#mongodb-method-cursor.maxTimeMS"> <code class="leafygreen-ui-1l06pbn"> cursor.maxTimeMS() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies a cumulative time limit in milliseconds for processing operations on a cursor. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.min/#mongodb-method-cursor.min"> <code class="leafygreen-ui-1l06pbn"> cursor.min() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies an inclusive lower index bound for a cursor. For use with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.hint/#mongodb-method-cursor.hint"> <code class="leafygreen-ui-1l06pbn"> cursor.hint() </code> </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.next/#mongodb-method-cursor.next"> <code class="leafygreen-ui-1l06pbn"> cursor.next() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the next document in a cursor. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.noCursorTimeout/#mongodb-method-cursor.noCursorTimeout"> <code class="leafygreen-ui-1l06pbn"> cursor.noCursorTimeout() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Instructs the server to avoid closing a cursor automatically after a period of inactivity. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.objsLeftInBatch/#mongodb-method-cursor.objsLeftInBatch"> <code class="leafygreen-ui-1l06pbn"> cursor.objsLeftInBatch() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the number of documents left in the current cursor batch. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.pretty/#mongodb-method-cursor.pretty"> <code class="leafygreen-ui-1l06pbn"> cursor.pretty() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Configures the cursor to display results in an easy-to-read format. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.readConcern/#mongodb-method-cursor.readConcern"> <code class="leafygreen-ui-1l06pbn"> cursor.readConcern() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-read-concern"> read concern </a> for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find() </code> </a> operation. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.readPref/#mongodb-method-cursor.readPref"> <code class="leafygreen-ui-1l06pbn"> cursor.readPref() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-read-preference"> read preference </a> to a cursor to control how the client directs queries to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.returnKey/#mongodb-method-cursor.returnKey"> <code class="leafygreen-ui-1l06pbn"> cursor.returnKey() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Modifies the cursor to return index keys rather than the documents. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.showRecordId/#mongodb-method-cursor.showRecordId"> <code class="leafygreen-ui-1l06pbn"> cursor.showRecordId() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds an internal storage engine ID field to each document returned by the cursor. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.size/#mongodb-method-cursor.size"> <code class="leafygreen-ui-1l06pbn"> cursor.size() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a count of the documents in the cursor after applying <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.skip/#mongodb-method-cursor.skip"> <code class="leafygreen-ui-1l06pbn"> skip() </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.limit/#mongodb-method-cursor.limit"> <code class="leafygreen-ui-1l06pbn"> limit() </code> </a> methods. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.skip/#mongodb-method-cursor.skip"> <code class="leafygreen-ui-1l06pbn"> cursor.skip() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a cursor that begins returning results only after passing or skipping a number of documents. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.sort/#mongodb-method-cursor.sort"> <code class="leafygreen-ui-1l06pbn"> cursor.sort() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns results ordered according to a sort specification. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.tailable/#mongodb-method-cursor.tailable"> <code class="leafygreen-ui-1l06pbn"> cursor.tailable() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Marks the cursor as tailable. Only valid for cursors over capped collections. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.toArray/#mongodb-method-cursor.toArray"> <code class="leafygreen-ui-1l06pbn"> cursor.toArray() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns an array that contains all documents returned by the cursor. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Database <a class="headerlink leafygreen-ui-1kepx47" href="#database" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="database"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.adminCommand/#mongodb-method-db.adminCommand"> <code class="leafygreen-ui-1l06pbn"> db.adminCommand() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Runs a command against the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.aggregate/#mongodb-method-db.aggregate"> <code class="leafygreen-ui-1l06pbn"> db.aggregate() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Runs admin/diagnostic pipeline which does not require an underlying collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.commandHelp/#mongodb-method-db.commandHelp"> <code class="leafygreen-ui-1l06pbn"> db.commandHelp() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns help information for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-database-command"> database command <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createCollection/#mongodb-method-db.createCollection"> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a new collection or a view. Commonly used to create a capped collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createView/#mongodb-method-db.createView"> <code class="leafygreen-ui-1l06pbn"> db.createView() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a view. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.currentOp/#mongodb-method-db.currentOp"> <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Reports the current in-progress operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.dropDatabase/#mongodb-method-db.dropDatabase"> <code class="leafygreen-ui-1l06pbn"> db.dropDatabase() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes the current database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.fsyncLock/#mongodb-method-db.fsyncLock"> <code class="leafygreen-ui-1l06pbn"> db.fsyncLock() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Flushes writes to disk and locks the database to prevent write operations and assist backup operations. Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/fsync/#mongodb-dbcommand-dbcmd.fsync"> <code class="leafygreen-ui-1l06pbn"> fsync </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.fsyncUnlock/#mongodb-method-db.fsyncUnlock"> <code class="leafygreen-ui-1l06pbn"> db.fsyncUnlock() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Allows writes to continue on a database locked with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.fsyncLock/#mongodb-method-db.fsyncLock"> <code class="leafygreen-ui-1l06pbn"> db.fsyncLock() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getCollection/#mongodb-method-db.getCollection"> <code class="leafygreen-ui-1l06pbn"> db.getCollection() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a collection or view object. Used to access collections with names that are not valid in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> . </span> </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getCollectionInfos/#mongodb-method-db.getCollectionInfos"> <code class="leafygreen-ui-1l06pbn"> db.getCollectionInfos() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns collection information for all collections and views in the current database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getCollectionNames/#mongodb-method-db.getCollectionNames"> <code class="leafygreen-ui-1l06pbn"> db.getCollectionNames() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Lists all collections and views in the current database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getLogComponents/#mongodb-method-db.getLogComponents"> <code class="leafygreen-ui-1l06pbn"> db.getLogComponents() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the log message verbosity levels. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getMongo/#mongodb-method-db.getMongo"> <code class="leafygreen-ui-1l06pbn"> db.getMongo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> connection object for the current connection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getName/#mongodb-method-db.getName"> <code class="leafygreen-ui-1l06pbn"> db.getName() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the name of the current database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getProfilingStatus/#mongodb-method-db.getProfilingStatus"> <code class="leafygreen-ui-1l06pbn"> db.getProfilingStatus() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document that reflects the current profiling level and the profiling threshold. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getReplicationInfo/#mongodb-method-db.getReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> db.getReplicationInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document with replication statistics. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getSiblingDB/#mongodb-method-db.getSiblingDB"> <code class="leafygreen-ui-1l06pbn"> db.getSiblingDB() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Provides access to the specified database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.hello/#mongodb-method-db.hello"> <code class="leafygreen-ui-1l06pbn"> db.hello() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document that reports the state of the replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.help/#mongodb-method-db.help"> <code class="leafygreen-ui-1l06pbn"> db.help() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Displays descriptions of common <code class="leafygreen-ui-1l06pbn"> db </code> object methods. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.hostInfo/#mongodb-method-db.hostInfo"> <code class="leafygreen-ui-1l06pbn"> db.hostInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document with information about the system MongoDB runs on. Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hostInfo/#mongodb-dbcommand-dbcmd.hostInfo"> <code class="leafygreen-ui-1l06pbn"> hostInfo </code> </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.killOp/#mongodb-method-db.killOp"> <code class="leafygreen-ui-1l06pbn"> db.killOp() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Terminates a specified operation. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.listCommands/#mongodb-method-db.listCommands"> <code class="leafygreen-ui-1l06pbn"> db.listCommands() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Displays a list of common database commands. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.logout/#mongodb-method-db.logout"> <code class="leafygreen-ui-1l06pbn"> db.logout() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <em> Deprecated </em> . Ends an authenticated session. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.printCollectionStats/#mongodb-method-db.printCollectionStats"> <code class="leafygreen-ui-1l06pbn"> db.printCollectionStats() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prints statistics from every collection. Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.stats/#mongodb-method-db.collection.stats"> <code class="leafygreen-ui-1l06pbn"> db.collection.stats() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.printReplicationInfo/#mongodb-method-db.printReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> db.printReplicationInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prints a report of the status of the replica set from the perspective of the primary. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.printSecondaryReplicationInfo/#mongodb-method-db.printSecondaryReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> db.printSecondaryReplicationInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prints the status of the replica set from the perspective of the secondaries. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.printShardingStatus/#mongodb-method-db.printShardingStatus"> <code class="leafygreen-ui-1l06pbn"> db.printShardingStatus() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prints a report of the sharding configuration and the chunk ranges. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.resetError/#mongodb-method-db.resetError"> <code class="leafygreen-ui-1l06pbn"> db.resetError() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <em> Removed in MongoDB 5.0. </em> Resets the last error status. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.rotateCertificates/#mongodb-method-db.rotateCertificates"> <code class="leafygreen-ui-1l06pbn"> db.rotateCertificates() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Performs online TLS certificate rotation. Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/rotateCertificates/#mongodb-dbcommand-dbcmd.rotateCertificates"> <code class="leafygreen-ui-1l06pbn"> rotateCertificates </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.runCommand/#mongodb-method-db.runCommand"> <code class="leafygreen-ui-1l06pbn"> db.runCommand() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Runs a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/#std-label-database-commands"> database command <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.serverBuildInfo/#mongodb-method-db.serverBuildInfo"> <code class="leafygreen-ui-1l06pbn"> db.serverBuildInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document that displays the compilation parameters for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance. Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/buildInfo/#mongodb-dbcommand-dbcmd.buildInfo"> <code class="leafygreen-ui-1l06pbn"> buildInfo </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.serverCmdLineOpts/#mongodb-method-db.serverCmdLineOpts"> <code class="leafygreen-ui-1l06pbn"> db.serverCmdLineOpts() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document with information about the runtime used to start the MongoDB instance. Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getCmdLineOpts/#mongodb-dbcommand-dbcmd.getCmdLineOpts"> <code class="leafygreen-ui-1l06pbn"> getCmdLineOpts </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.serverStatus/#mongodb-method-db.serverStatus"> <code class="leafygreen-ui-1l06pbn"> db.serverStatus() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document that provides an overview of the state of the database process. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.setLogLevel/#mongodb-method-db.setLogLevel"> <code class="leafygreen-ui-1l06pbn"> db.setLogLevel() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Sets a single log message verbosity level. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.setProfilingLevel/#mongodb-method-db.setProfilingLevel"> <code class="leafygreen-ui-1l06pbn"> db.setProfilingLevel() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Modifies the current level of database profiling. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.shutdownServer/#mongodb-method-db.shutdownServer"> <code class="leafygreen-ui-1l06pbn"> db.shutdownServer() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Shuts down the current <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> process cleanly and safely. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.stats/#mongodb-method-db.stats"> <code class="leafygreen-ui-1l06pbn"> db.stats() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document that reports on the state of the current database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.version/#mongodb-method-db.version"> <code class="leafygreen-ui-1l06pbn"> db.version() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the version of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.watch/#mongodb-method-db.watch"> <code class="leafygreen-ui-1l06pbn"> db.watch() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Opens a <a class="leafygreen-ui-tqgtui" href="/docs/manual/changeStreams/#std-label-changeStreams"> change stream cursor </a> for a database to report on all its non- <code class="leafygreen-ui-1l06pbn"> system </code> collections. Cannot be opened on the <code class="leafygreen-ui-1l06pbn"> admin </code> , <code class="leafygreen-ui-1l06pbn"> local </code> or <code class="leafygreen-ui-1l06pbn"> config </code> databases. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Query Plan Cache <a class="headerlink leafygreen-ui-1kepx47" href="#query-plan-cache" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="query-plan-cache"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.getPlanCache/#mongodb-method-db.collection.getPlanCache"> <code class="leafygreen-ui-1l06pbn"> db.collection.getPlanCache() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns an interface to access the query plan cache object and associated PlanCache methods for a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/PlanCache.clear/#mongodb-method-PlanCache.clear"> <code class="leafygreen-ui-1l06pbn"> PlanCache.clear() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Clears all the cached query plans for a collection. Accessible through the plan cache object of a specific collection, i.e. <code class="leafygreen-ui-1l06pbn"> db.collection.getPlanCache().clear() </code> . </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/PlanCache.clearPlansByQuery/#mongodb-method-PlanCache.clearPlansByQuery"> <code class="leafygreen-ui-1l06pbn"> PlanCache.clearPlansByQuery() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Clears the cached query plans for the specified <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-plan-cache-query-shape"> plan cache query shape </a> . Accessible through the plan cache object of a specific collection, i.e. <code class="leafygreen-ui-1l06pbn"> db.collection.getPlanCache().clearPlansByQuery() </code> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/PlanCache.help/#mongodb-method-PlanCache.help"> <code class="leafygreen-ui-1l06pbn"> PlanCache.help() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Displays the methods available for a collection's query plan cache. Accessible through the plan cache object of a specific collection, i.e. <code class="leafygreen-ui-1l06pbn"> db.collection.getPlanCache().help() </code> . </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/PlanCache.list/#mongodb-method-PlanCache.list"> <code class="leafygreen-ui-1l06pbn"> PlanCache.list() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the plan cache information for a collection. Accessible through the plan cache object of a specific collection, i.e. <code class="leafygreen-ui-1l06pbn"> db.collection.getPlanCache().list() </code> . </div> </div> </td> </tr> </tbody> </table> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-bulk-operation-methods"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Bulk Write Operation <a class="headerlink leafygreen-ui-1kepx47" href="#bulk-write-operation" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="bulk-write-operation"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.initializeOrderedBulkOp/#mongodb-method-db.collection.initializeOrderedBulkOp"> <code class="leafygreen-ui-1l06pbn"> db.collection.initializeOrderedBulkOp() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Initializes a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> operations builder for an ordered list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.initializeUnorderedBulkOp/#mongodb-method-db.collection.initializeUnorderedBulkOp"> <code class="leafygreen-ui-1l06pbn"> db.collection.initializeUnorderedBulkOp() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Initializes a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> operations builder for an unordered list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Bulk operations builder. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.execute/#mongodb-method-Bulk.execute"> <code class="leafygreen-ui-1l06pbn"> Bulk.execute() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Executes a list of operations in bulk. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find/#mongodb-method-Bulk.find"> <code class="leafygreen-ui-1l06pbn"> Bulk.find() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the query condition for an update or a remove operation. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.arrayFilters/#mongodb-method-Bulk.find.arrayFilters"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.arrayFilters() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the filters that determine which elements of an array to update for an <code class="leafygreen-ui-1l06pbn"> update </code> or <code class="leafygreen-ui-1l06pbn"> updateOne </code> operation. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.collation/#mongodb-method-Bulk.find.collation"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.collation() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> collation </a> for the query condition. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.delete/#mongodb-method-Bulk.find.delete"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.delete() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds a multiple document delete operation to a list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.deleteOne/#mongodb-method-Bulk.find.deleteOne"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.deleteOne() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds a single document delete operation to a list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.hint/#mongodb-method-Bulk.find.hint"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.hint() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies the index to use for the update/replace operation. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.remove/#mongodb-method-Bulk.find.remove"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.remove() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An alias for <code class="leafygreen-ui-1l06pbn"> Bulk.find.delete() </code> . </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.removeOne/#mongodb-method-Bulk.find.removeOne"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.removeOne() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An alias for <code class="leafygreen-ui-1l06pbn"> Bulk.find.deleteOne() </code> . </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.replaceOne/#mongodb-method-Bulk.find.replaceOne"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.replaceOne() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds a single document replacement operation to a list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.updateOne/#mongodb-method-Bulk.find.updateOne"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.updateOne() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds a single document update operation to a list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.update/#mongodb-method-Bulk.find.update"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.update() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds a <code class="leafygreen-ui-1l06pbn"> multi </code> update operation to a list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.find.upsert/#mongodb-method-Bulk.find.upsert"> <code class="leafygreen-ui-1l06pbn"> Bulk.find.upsert() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies <code class="leafygreen-ui-1l06pbn"> upsert: true </code> for an update operation. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.getOperations/#mongodb-method-Bulk.getOperations"> <code class="leafygreen-ui-1l06pbn"> Bulk.getOperations() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns an array of write operations executed in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> operations object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.insert/#mongodb-method-Bulk.insert"> <code class="leafygreen-ui-1l06pbn"> Bulk.insert() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds an insert operation to a list of operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.tojson/#mongodb-method-Bulk.toJSON"> <code class="leafygreen-ui-1l06pbn"> Bulk.toJSON() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a JSON document that contains the number of operations and batches in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk/#mongodb-method-Bulk"> <code class="leafygreen-ui-1l06pbn"> Bulk() </code> </a> operations object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.toString/#mongodb-method-Bulk.toString"> <code class="leafygreen-ui-1l06pbn"> Bulk.toString() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.tojson/#mongodb-method-Bulk.toJSON"> <code class="leafygreen-ui-1l06pbn"> Bulk.toJSON() </code> </a> results as a string. </div> </div> </td> </tr> </tbody> </table> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-user-management-methods"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> User Management <a class="headerlink leafygreen-ui-1kepx47" href="#user-management" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="user-management"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.auth/#mongodb-method-db.auth"> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Authenticates a user to a database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.changeUserPassword/#mongodb-method-db.changeUserPassword"> <code class="leafygreen-ui-1l06pbn"> db.changeUserPassword() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Changes an existing user's password. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createUser/#mongodb-method-db.createUser"> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a new user. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.dropUser/#mongodb-method-db.dropUser"> <code class="leafygreen-ui-1l06pbn"> db.dropUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes a single user. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.dropAllUsers/#mongodb-method-db.dropAllUsers"> <code class="leafygreen-ui-1l06pbn"> db.dropAllUsers() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deletes all users associated with a database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getUser/#mongodb-method-db.getUser"> <code class="leafygreen-ui-1l06pbn"> db.getUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns information about the specified user. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getUsers/#mongodb-method-db.getUsers"> <code class="leafygreen-ui-1l06pbn"> db.getUsers() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns information about all users associated with a database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.grantRolesToUser/#mongodb-method-db.grantRolesToUser"> <code class="leafygreen-ui-1l06pbn"> db.grantRolesToUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Grants a role and its privileges to a user. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.removeUser/#mongodb-method-db.removeUser"> <code class="leafygreen-ui-1l06pbn"> db.removeUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deprecated. Removes a user from a database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.revokeRolesFromUser/#mongodb-method-db.revokeRolesFromUser"> <code class="leafygreen-ui-1l06pbn"> db.revokeRolesFromUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes a role from a user. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.updateUser/#mongodb-method-db.updateUser"> <code class="leafygreen-ui-1l06pbn"> db.updateUser() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Updates user data. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prompts for the password as an alternative to specifying passwords directly in various <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> user authentication/management methods. </div> </div> </td> </tr> </tbody> </table> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-role-management-methods"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Role Management <a class="headerlink leafygreen-ui-1kepx47" href="#role-management" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="role-management"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createRole/#mongodb-method-db.createRole"> <code class="leafygreen-ui-1l06pbn"> db.createRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a role and specifies its privileges. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.dropRole/#mongodb-method-db.dropRole"> <code class="leafygreen-ui-1l06pbn"> db.dropRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deletes a user-defined role. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.dropAllRoles/#mongodb-method-db.dropAllRoles"> <code class="leafygreen-ui-1l06pbn"> db.dropAllRoles() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deletes all user-defined roles associated with a database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getRole/#mongodb-method-db.getRole"> <code class="leafygreen-ui-1l06pbn"> db.getRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns information for the specified role. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getRoles/#mongodb-method-db.getRoles"> <code class="leafygreen-ui-1l06pbn"> db.getRoles() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns information for all the user-defined roles in a database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.grantPrivilegesToRole/#mongodb-method-db.grantPrivilegesToRole"> <code class="leafygreen-ui-1l06pbn"> db.grantPrivilegesToRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Assigns privileges to a user-defined role. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.revokePrivilegesFromRole/#mongodb-method-db.revokePrivilegesFromRole"> <code class="leafygreen-ui-1l06pbn"> db.revokePrivilegesFromRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes the specified privileges from a user-defined role. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.grantRolesToRole/#mongodb-method-db.grantRolesToRole"> <code class="leafygreen-ui-1l06pbn"> db.grantRolesToRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies roles from which a user-defined role inherits privileges. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.revokeRolesFromRole/#mongodb-method-db.revokeRolesFromRole"> <code class="leafygreen-ui-1l06pbn"> db.revokeRolesFromRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes inherited roles from a role. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.updateRole/#mongodb-method-db.updateRole"> <code class="leafygreen-ui-1l06pbn"> db.updateRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Updates a user-defined role. </div> </div> </td> </tr> </tbody> </table> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-replica-set-functions"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Replication <a class="headerlink leafygreen-ui-1kepx47" href="#replication" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="replication"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.add/#mongodb-method-rs.add"> <code class="leafygreen-ui-1l06pbn"> rs.add() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds a member to a replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.addArb/#mongodb-method-rs.addArb"> <code class="leafygreen-ui-1l06pbn"> rs.addArb() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-arbiter"> arbiter </a> to a replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.conf/#mongodb-method-rs.conf"> <code class="leafygreen-ui-1l06pbn"> rs.conf() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the replica set configuration document. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.freeze/#mongodb-method-rs.freeze"> <code class="leafygreen-ui-1l06pbn"> rs.freeze() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prevents the current member from seeking election as primary for a period of time. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.help/#mongodb-method-rs.help"> <code class="leafygreen-ui-1l06pbn"> rs.help() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns basic help text for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> functions. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.initiate/#mongodb-method-rs.initiate"> <code class="leafygreen-ui-1l06pbn"> rs.initiate() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Initializes a new replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.printReplicationInfo/#mongodb-method-rs.printReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> rs.printReplicationInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prints a formatted report of the replica set status from the perspective of the primary. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.printSecondaryReplicationInfo/#mongodb-method-rs.printSecondaryReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> rs.printSecondaryReplicationInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prints a formatted report of the replica set status from the perspective of the secondaries. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.reconfig/#mongodb-method-rs.reconfig"> <code class="leafygreen-ui-1l06pbn"> rs.reconfig() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Re-configures a replica set by applying a new replica set configuration object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.remove/#mongodb-method-rs.remove"> <code class="leafygreen-ui-1l06pbn"> rs.remove() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Remove a member from a replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document with information about the state of the replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.stepDown/#mongodb-method-rs.stepDown"> <code class="leafygreen-ui-1l06pbn"> rs.stepDown() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Causes the current <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> to become a secondary which forces an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-election"> election <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.syncFrom/#mongodb-method-rs.syncFrom"> <code class="leafygreen-ui-1l06pbn"> rs.syncFrom() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Sets the member that this replica set member will sync from, overriding the default sync target selection logic. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Sharding <a class="headerlink leafygreen-ui-1kepx47" href="#sharding" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sharding"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/convertShardKeyToHashed/#mongodb-method-convertShardKeyToHashed"> <code class="leafygreen-ui-1l06pbn"> convertShardKeyToHashed() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the hashed value for the input. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.abortReshardCollection/#mongodb-method-sh.abortReshardCollection"> <code class="leafygreen-ui-1l06pbn"> sh.abortReshardCollection() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Aborts a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-reshard-a-collection/#std-label-sharding-resharding"> resharding operation <!-- --> . </a> </p> <div> <p> <em> New <!-- --> in version <!-- --> 5.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.abortUnshardCollection/#mongodb-method-sh.abortUnshardCollection"> <code class="leafygreen-ui-1l06pbn"> sh.abortUnshardCollection() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Stops an in-progress <code class="leafygreen-ui-1l06pbn"> unshardCollection </code> operation. </p> <div> <p> <em> New <!-- --> in version <!-- --> 8.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.addShard/#mongodb-method-sh.addShard"> <code class="leafygreen-ui-1l06pbn"> sh.addShard() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Adds a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard"> shard </a> to a sharded cluster. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.addShardTag/#mongodb-method-sh.addShardTag"> <code class="leafygreen-ui-1l06pbn"> sh.addShardTag() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> This method aliases to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.addShardToZone/#mongodb-method-sh.addShardToZone"> <code class="leafygreen-ui-1l06pbn"> sh.addShardToZone() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.addShardToZone/#mongodb-method-sh.addShardToZone"> <code class="leafygreen-ui-1l06pbn"> sh.addShardToZone() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Associates a shard to a zone. Supports configuring <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/zone-sharding/#std-label-zone-sharding"> zones </a> in sharded clusters. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.addTagRange/#mongodb-method-sh.addTagRange"> <code class="leafygreen-ui-1l06pbn"> sh.addTagRange() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> This method aliases to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.updateZoneKeyRange/#mongodb-method-sh.updateZoneKeyRange"> <code class="leafygreen-ui-1l06pbn"> sh.updateZoneKeyRange() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.balancerCollectionStatus/#mongodb-method-sh.balancerCollectionStatus"> <code class="leafygreen-ui-1l06pbn"> sh.balancerCollectionStatus() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns information on whether the chunks of a sharded collection are balanced. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.commitReshardCollection/#mongodb-method-sh.commitReshardCollection"> <code class="leafygreen-ui-1l06pbn"> sh.commitReshardCollection() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Forces a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-reshard-a-collection/#std-label-sharding-resharding"> resharding operation </a> to block writes and complete. </p> <div> <p> <em> New <!-- --> in version <!-- --> 5.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.disableBalancing/#mongodb-method-sh.disableBalancing"> <code class="leafygreen-ui-1l06pbn"> sh.disableBalancing() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Disable balancing on a single collection in a sharded database. Does not affect balancing of other collections in a sharded cluster. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.enableBalancing/#mongodb-method-sh.enableBalancing"> <code class="leafygreen-ui-1l06pbn"> sh.enableBalancing() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Activates the sharded collection balancer process if previously disabled using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.disableBalancing/#mongodb-method-sh.disableBalancing"> <code class="leafygreen-ui-1l06pbn"> sh.disableBalancing() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.disableAutoMerger/#mongodb-method-sh.disableAutoMerger"> <code class="leafygreen-ui-1l06pbn"> sh.disableAutoMerger() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Disables automatic <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-chunk"> chunk </a> merges for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-namespace"> namespace <!-- --> . </a> </p> <div> <p> <em> New <!-- --> in version <!-- --> 7.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.disableAutoSplit/#mongodb-method-sh.disableAutoSplit"> <code class="leafygreen-ui-1l06pbn"> sh.disableAutoSplit() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Disables auto-splitting for the sharded cluster. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 6.0.3, automatic chunk splitting is not performed. This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.enableAutoMerger/#mongodb-method-sh.enableAutoMerger"> <code class="leafygreen-ui-1l06pbn"> sh.enableAutoMerger() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Enables automatic <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-chunk"> chunk </a> merges for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-namespace"> namespace <!-- --> . </a> </p> <div> <p> <em> New <!-- --> in version <!-- --> 7.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.enableAutoSplit/#mongodb-method-sh.enableAutoSplit"> <code class="leafygreen-ui-1l06pbn"> sh.enableAutoSplit() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Enables auto-splitting for the sharded cluster. </p> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 6.0.3, automatic chunk splitting is not performed. This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.enableSharding/#mongodb-method-sh.enableSharding"> <code class="leafygreen-ui-1l06pbn"> sh.enableSharding() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.getBalancerState/#mongodb-method-sh.getBalancerState"> <code class="leafygreen-ui-1l06pbn"> sh.getBalancerState() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a boolean to report if the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-balancer"> balancer </a> is currently enabled. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.getShardedDataDistribution/#mongodb-method-sh.getShardedDataDistribution"> <code class="leafygreen-ui-1l06pbn"> sh.getShardedDataDistribution() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Returns data distribution information for sharded collections. <code class="leafygreen-ui-1l06pbn"> sh.getShardedDataDistribution() </code> is a shell helper method for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/shardedDataDistribution/#mongodb-pipeline-pipe.-shardedDataDistribution"> <code class="leafygreen-ui-1l06pbn"> $shardedDataDistribution </code> </a> aggregation pipeline stage. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.removeTagRange/#mongodb-method-sh.removeTagRange"> <code class="leafygreen-ui-1l06pbn"> sh.removeTagRange() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> This method aliases to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.removeRangeFromZone/#mongodb-method-sh.removeRangeFromZone"> <code class="leafygreen-ui-1l06pbn"> sh.removeRangeFromZone() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.removeRangeFromZone/#mongodb-method-sh.removeRangeFromZone"> <code class="leafygreen-ui-1l06pbn"> sh.removeRangeFromZone() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes an association between a range of shard keys and a zone. Supports configuring <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/zone-sharding/#std-label-zone-sharding"> zones </a> in sharded clusters. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.help/#mongodb-method-sh.help"> <code class="leafygreen-ui-1l06pbn"> sh.help() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns help text for the <code class="leafygreen-ui-1l06pbn"> sh </code> methods. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.isBalancerRunning/#mongodb-method-sh.isBalancerRunning"> <code class="leafygreen-ui-1l06pbn"> sh.isBalancerRunning() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document describing the status of the balancer. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.moveChunk/#mongodb-method-sh.moveChunk"> <code class="leafygreen-ui-1l06pbn"> sh.moveChunk() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Migrates a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-chunk"> chunk </a> in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-sharded-cluster"> sharded cluster <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.removeShardTag/#mongodb-method-sh.removeShardTag"> <code class="leafygreen-ui-1l06pbn"> sh.removeShardTag() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> This method is an alias for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.removeShardFromZone/#mongodb-method-sh.removeShardFromZone"> <code class="leafygreen-ui-1l06pbn"> sh.removeShardFromZone() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.removeShardFromZone/#mongodb-method-sh.removeShardFromZone"> <code class="leafygreen-ui-1l06pbn"> sh.removeShardFromZone() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes the association between a shard and a zone. Use to manage <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/zone-sharding/#std-label-zone-sharding"> zone sharding <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.reshardCollection/#mongodb-method-sh.reshardCollection"> <code class="leafygreen-ui-1l06pbn"> sh.reshardCollection() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Initiates a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-reshard-a-collection/#std-label-sharding-resharding"> resharding operation </a> to change the shard key for a collection, changing the distribution of your data. </p> <div> <p> <em> New <!-- --> in version <!-- --> 5.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.setBalancerState/#mongodb-method-sh.setBalancerState"> <code class="leafygreen-ui-1l06pbn"> sh.setBalancerState() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Enables or disables the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-balancer"> balancer </a> which migrates <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-chunk"> chunks </a> between <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard"> shards <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.shardCollection/#mongodb-method-sh.shardCollection"> <code class="leafygreen-ui-1l06pbn"> sh.shardCollection() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Enables sharding for a collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.splitAt/#mongodb-method-sh.splitAt"> <code class="leafygreen-ui-1l06pbn"> sh.splitAt() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Divides an existing <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-chunk"> chunk </a> into two chunks using a specific value of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key"> shard key </a> as the dividing point. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.splitFind/#mongodb-method-sh.splitFind"> <code class="leafygreen-ui-1l06pbn"> sh.splitFind() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Divides an existing <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-chunk"> chunk </a> that contains a document matching a query into two approximately equal chunks. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.startAutoMerger/#mongodb-method-sh.startAutoMerger"> <code class="leafygreen-ui-1l06pbn"> sh.startAutoMerger() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Enables the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/automerger-concept/#std-label-automerger-concept"> AutoMerger <!-- --> . </a> </p> <div> <p> <em> New <!-- --> in version <!-- --> 7.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.startBalancer/#mongodb-method-sh.startBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.startBalancer() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Enables the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-balancer"> balancer </a> and waits for balancing to start. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.status/#mongodb-method-sh.status"> <code class="leafygreen-ui-1l06pbn"> sh.status() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Reports on the status of a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-sharded-cluster"> sharded cluster </a> , as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.printShardingStatus/#mongodb-method-db.printShardingStatus"> <code class="leafygreen-ui-1l06pbn"> db.printShardingStatus() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.stopAutoMerger/#mongodb-method-sh.stopAutoMerger"> <code class="leafygreen-ui-1l06pbn"> sh.stopAutoMerger() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Disables the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/automerger-concept/#std-label-automerger-concept"> AutoMerger <!-- --> . </a> </p> <div> <p> <em> New <!-- --> in version <!-- --> 7.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.stopBalancer/#mongodb-method-sh.stopBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.stopBalancer() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Disables the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-balancer"> balancer </a> and waits for any in progress balancing rounds to complete. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.unshardCollection/#mongodb-method-sh.unshardCollection"> <code class="leafygreen-ui-1l06pbn"> sh.unshardCollection() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Unshards an existing sharded collection and moves the collection data onto a single shard. When you unshard a collection, the collection cannot be partitioned across multiple <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard"> shards </a> and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key"> shard key </a> is removed. </p> <div> <p> <em> New <!-- --> in version <!-- --> 8.0 </em> . </p> </div> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.updateZoneKeyRange/#mongodb-method-sh.updateZoneKeyRange"> <code class="leafygreen-ui-1l06pbn"> sh.updateZoneKeyRange() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Associates a range of shard keys to a zone. Supports configuring <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/zone-sharding/#std-label-zone-sharding"> zones </a> in sharded clusters. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.waitForBalancer/#mongodb-method-sh.waitForBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.waitForBalancer() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Internal. Waits for the balancer state to change. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.waitForBalancerOff/#mongodb-method-sh.waitForBalancerOff"> <code class="leafygreen-ui-1l06pbn"> sh.waitForBalancerOff() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Internal. Waits until the balancer stops running. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.waitForPingChange/#mongodb-method-sh.waitForPingChange"> <code class="leafygreen-ui-1l06pbn"> sh.waitForPingChange() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Internal. Waits for a change in ping state from one of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> in the sharded cluster. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Constructors <a class="headerlink leafygreen-ui-1kepx47" href="#constructors" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="constructors"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Binary.createFromBase64/#mongodb-method-Binary.createFromBase64"> <code class="leafygreen-ui-1l06pbn"> Binary.createFromBase64() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a binary object from a base64 value. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Binary.createFromHexString/#mongodb-method-Binary.createFromHexString"> <code class="leafygreen-ui-1l06pbn"> Binary.createFromHexString() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a binary object from a hexadecimal value. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/BinData/#mongodb-method-BinData"> <code class="leafygreen-ui-1l06pbn"> BinData() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-binary-data"> binary data object <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/BulkWriteResult/#mongodb-method-BulkWriteResult"> <code class="leafygreen-ui-1l06pbn"> BulkWriteResult() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Wrapper around the result set from <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Bulk.execute/#mongodb-method-Bulk.execute"> <code class="leafygreen-ui-1l06pbn"> Bulk.execute() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Date/#mongodb-method-Date"> <code class="leafygreen-ui-1l06pbn"> Date() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a date object. By default creates a date object including the current date. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/HexData/#mongodb-method-HexData"> <code class="leafygreen-ui-1l06pbn"> HexData() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-document-bson-type-binary-data"> binary data object <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/ObjectId/#mongodb-method-ObjectId"> <code class="leafygreen-ui-1l06pbn"> ObjectId() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-ObjectId"> ObjectId <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/ObjectId.createFromBase64/#mongodb-method-ObjectId.createFromBase64"> <code class="leafygreen-ui-1l06pbn"> ObjectId.createFromBase64() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-ObjectId"> ObjectId </a> from a base64 value. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/ObjectId.createFromHexString/#mongodb-method-ObjectId.createFromHexString"> <code class="leafygreen-ui-1l06pbn"> ObjectId.createFromHexString() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-ObjectId"> ObjectId </a> from a hexadecimal value. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/ObjectId.getTimestamp/#mongodb-method-ObjectId.getTimestamp"> <code class="leafygreen-ui-1l06pbn"> ObjectId.getTimestamp() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the timestamp portion of an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-ObjectId"> ObjectId <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/ObjectId.toString/#mongodb-method-ObjectId.toString"> <code class="leafygreen-ui-1l06pbn"> ObjectId.toString() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Displays the string representation of an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-ObjectId"> ObjectId <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/UUID/"> UUID() </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Converts a 32-byte hexadecimal string to the UUID BSON subtype. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/WriteResult/#mongodb-method-WriteResult"> <code class="leafygreen-ui-1l06pbn"> WriteResult() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Wrapper around the result set from write methods. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/WriteResult.hasWriteError/#mongodb-method-WriteResult.hasWriteError"> <code class="leafygreen-ui-1l06pbn"> WriteResult.hasWriteError() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a boolean specifying whether the results include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/WriteResult/#mongodb-data-WriteResult.writeError"> <code class="leafygreen-ui-1l06pbn"> WriteResult.writeError </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/WriteResult.hasWriteConcernError/#mongodb-method-WriteResult.hasWriteConcernError"> <code class="leafygreen-ui-1l06pbn"> WriteResult.hasWriteConcernError() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a boolean specifying whether whether the results include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/WriteResult/#mongodb-data-WriteResult.writeConcernError"> <code class="leafygreen-ui-1l06pbn"> WriteResult.writeConcernError </code> . </a> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Connection <a class="headerlink leafygreen-ui-1kepx47" href="#connection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="connection"> </div> </a> </h2> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/connect/"> connect() </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Connects to a MongoDB instance and to a specified database on that instance. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a new connection object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo.getDB/#mongodb-method-Mongo.getDB"> <code class="leafygreen-ui-1l06pbn"> Mongo.getDB() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a database object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo.getReadPrefMode/#mongodb-method-Mongo.getReadPrefMode"> <code class="leafygreen-ui-1l06pbn"> Mongo.getReadPrefMode() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the current read preference mode for the MongoDB connection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo.getReadPrefTagSet/#mongodb-method-Mongo.getReadPrefTagSet"> <code class="leafygreen-ui-1l06pbn"> Mongo.getReadPrefTagSet() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the read preference tag set for the MongoDB connection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo.setCausalConsistency/#mongodb-method-Mongo.setCausalConsistency"> <code class="leafygreen-ui-1l06pbn"> Mongo.setCausalConsistency() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Enables or disables causal consistency on the connection object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo.setReadPref/#mongodb-method-Mongo.setReadPref"> <code class="leafygreen-ui-1l06pbn"> Mongo.setReadPref() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Sets the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-read-preference"> read preference </a> for the MongoDB connection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo.startSession/#mongodb-method-Mongo.startSession"> <code class="leafygreen-ui-1l06pbn"> Mongo.startSession() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Starts a session on the connection object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo.watch/#mongodb-method-Mongo.watch"> <code class="leafygreen-ui-1l06pbn"> Mongo.watch() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Opens a <a class="leafygreen-ui-tqgtui" href="/docs/manual/changeStreams/#std-label-changeStreams"> change stream cursor </a> for a deployment to report on all its non- <code class="leafygreen-ui-1l06pbn"> system </code> collections across all its databases, excluding the internal <code class="leafygreen-ui-1l06pbn"> admin </code> , <code class="leafygreen-ui-1l06pbn"> local </code> , and <code class="leafygreen-ui-1l06pbn"> config </code> databases. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Session/#mongodb-method-Session"> <code class="leafygreen-ui-1l06pbn"> Session() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The session object. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/SessionOptions/#mongodb-method-SessionOptions"> <code class="leafygreen-ui-1l06pbn"> SessionOptions() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The options object for the session. </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Client-Side Field Level Encryption <a class="headerlink leafygreen-ui-1kepx47" href="#client-side-field-level-encryption" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="client-side-field-level-encryption"> </div> </a> </h2> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> client-side field level encryption methods require a database connection with client-side field level encryption enabled. If the current database connection was not initiated with client-side field level encryption enabled, either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> constructor from the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to establish a connection with the required client-side field level encryption options. The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> method supports the following Key Management Service (KMS) providers for Customer Master Key (CMK) management: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-aws"> Amazon Web Services KMS </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-azure"> Azure Key Vault </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-gcp"> Google Cloud Platform KMS </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-local"> Locally Managed Key </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <em> or </em> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-label-mongosh-client-side-field-level-encryption-options" target="_self"> <span> command line options </span> </a> to establish a connection with the required options. The command line options only support the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-aws"> Amazon Web Services KMS </a> provider for CMK management. </p> </li> </ul> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/getKeyVault/#mongodb-method-getKeyVault"> <code class="leafygreen-ui-1l06pbn"> getKeyVault() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the key vault object for the current MongoDB connection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.createDataKey/#mongodb-method-KeyVault.createDataKey"> <code class="leafygreen-ui-1l06pbn"> KeyVault.createDataKey() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An alias for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.createKey/#mongodb-method-KeyVault.createKey"> <code class="leafygreen-ui-1l06pbn"> KeyVault.createKey() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.createKey/#mongodb-method-KeyVault.createKey"> <code class="leafygreen-ui-1l06pbn"> KeyVault.createKey() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a data encryption key for use with client-side field level encryption. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.deleteKey/#mongodb-method-KeyVault.deleteKey"> <code class="leafygreen-ui-1l06pbn"> KeyVault.deleteKey() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deletes the specified data encryption key from the key vault. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.getKey/#mongodb-method-KeyVault.getKey"> <code class="leafygreen-ui-1l06pbn"> KeyVault.getKey() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Retrieves the specified data encryption key from the key vault. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.getKeys/#mongodb-method-KeyVault.getKeys"> <code class="leafygreen-ui-1l06pbn"> KeyVault.getKeys() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Retrieves all keys in the key vault. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.addKeyAlternateName/#mongodb-method-KeyVault.addKeyAlternateName"> <code class="leafygreen-ui-1l06pbn"> KeyVault.addKeyAlternateName() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Associates a key's alternative name to the specified data encryption key. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.addKeyName/#mongodb-method-KeyVault.addKeyAltName"> <code class="leafygreen-ui-1l06pbn"> KeyVault.addKeyAltName() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An alias for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.addKeyAlternateName/#mongodb-method-KeyVault.addKeyAlternateName"> <code class="leafygreen-ui-1l06pbn"> KeyVault.addKeyAlternateName() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.removeKeyAlternateName/#mongodb-method-KeyVault.removeKeyAlternateName"> <code class="leafygreen-ui-1l06pbn"> KeyVault.removeKeyAlternateName() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes a key's alternative name from the specified data encryption key. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.removeKeyAltName/#mongodb-method-KeyVault.removeKeyAltName"> <code class="leafygreen-ui-1l06pbn"> KeyVault.removeKeyAltName() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An alias for <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.removeKeyAlternateName/#mongodb-method-KeyVault.removeKeyAlternateName"> <code class="leafygreen-ui-1l06pbn"> KeyVault.removeKeyAlternateName() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.getKeyByAltName/#mongodb-method-KeyVault.getKeyByAltName"> <code class="leafygreen-ui-1l06pbn"> KeyVault.getKeyByAltName() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Retrieves keys with the specified key alternative name. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/KeyVault.rewrapManyDataKey/#mongodb-method-KeyVault.rewrapManyDataKey"> <code class="leafygreen-ui-1l06pbn"> KeyVault.rewrapManyDataKey() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Decrypts multiple data keys and re-encrypts them. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/getClientEncryption/#mongodb-method-getClientEncryption"> <code class="leafygreen-ui-1l06pbn"> getClientEncryption() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the client encryption object for supporting explicit encryption/decryption of fields. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/ClientEncryption.createEncryptedCollection/#mongodb-method-ClientEncryption.createEncryptedCollection"> <code class="leafygreen-ui-1l06pbn"> ClientEncryption.createEncryptedCollection() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a collection with encrypted fields. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/ClientEncryption.encrypt/#mongodb-method-ClientEncryption.encrypt"> <code class="leafygreen-ui-1l06pbn"> ClientEncryption.encrypt() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Encrypts a field using a specified data encryption key and encryption algorithm. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/ClientEncryption.decrypt/#mongodb-method-ClientEncryption.decrypt"> <code class="leafygreen-ui-1l06pbn"> ClientEncryption.decrypt() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Decrypts a field using the associated data encryption key and encryption algorithm. </div> </div> </td> </tr> </tbody> </table> </div> </section> </section>
https://www.mongodb.com/docs/manual/core/timeseries/timeseries-querying/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> About Querying Time Series Data <a class="headerlink leafygreen-ui-1kepx47" href="#about-querying-time-series-data" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="about-querying-time-series-data"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#querying-the-metafield" target="_self"> <span> Querying the metaField </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#querying-the-timefield" target="_self"> <span> Querying the timeField </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#block-processing" target="_self"> <span> Block Processing </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB groups documents with matching <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-timeseries-collections-metafield"> metaFields </a> to optimize the storage and query latency of time series data. Your choice of <code class="leafygreen-ui-1l06pbn"> metaField </code> has the biggest impact on optimizing queries in your application. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Querying the metaField <a class="headerlink leafygreen-ui-1kepx47" href="#querying-the-metafield" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="querying-the-metafield"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You query a time series collection the same way you query a standard MongoDB collection. For an example query and example aggregation pipeline, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-procedures/#std-label-timeseries-query-example"> Query a Time Series Collection </a> . For a list of querying best practices, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-best-practices/#std-label-tsc-best-practice-optimize-query-performance"> Query Best Practices <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Queries against time series data typically focus on a single time series in the collection. For example, consider a time series collection that tracks stock data using the following schema: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: 573a1397f29313caabce8347,\n\n \"ticker\": \"MDB\",\n \"timestamp\": ISODate(\"2024-07-24T13:45:00.000Z\"),\n \"price\": 248.21,\n \"volume\": 6930\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <!-- -->573a1397f29313caabce8347<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"ticker"</span>: <span class="lg-highlight-string">"MDB"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"timestamp"</span>: <span class="lg-highlight-title lg-highlight-class">ISODate</span>(<span class="lg-highlight-string">"2024-07-24T13:45:00.000Z"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"price"</span>: <span class="lg-highlight-number">248.21</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"volume"</span>: <span class="lg-highlight-number">6930</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The collection has the following settings: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"timeseries: {\n timeField: \"timestamp\",\n metaField: \"ticker\",\n granularity: \"seconds\"\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">timeseries</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">timeField</span>: <span class="lg-highlight-string">"timestamp"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">metaField</span>: <span class="lg-highlight-string">"ticker"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">granularity</span>: <span class="lg-highlight-string">"seconds"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB groups documents with matching <code class="leafygreen-ui-1l06pbn"> ticker </code> values. Instead of having to check for matches across all fields in all documents, the server only has to check against the <code class="leafygreen-ui-1l06pbn"> metaField </code> , in this case <code class="leafygreen-ui-1l06pbn"> ticker </code> , to narrow down the search range to a unique time series. This fits the expected use case, which is searching for activity on a single stock. A user searching for information on MongoDB stock (MDB) doesn't need to consider results for Amazon (AMZN). </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Querying the timeField <a class="headerlink leafygreen-ui-1kepx47" href="#querying-the-timefield" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="querying-the-timefield"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The second major dimension for querying time series data is time. Since MongoDB groups documents that have both an identical <code class="leafygreen-ui-1l06pbn"> metaField </code> value and close <code class="leafygreen-ui-1l06pbn"> timeField </code> values, this further narrows the scope of a query to a range of buckets. Recent transactions are kept in memory, so it's easy to stream data in real time. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-timeseries-querying-block-processing"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Block Processing <a class="headerlink leafygreen-ui-1kepx47" href="#block-processing" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="block-processing"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in version 8.0, MongoDB may execute certain time series queries using block processing. This performance improvement processes queries in "blocks" of data, rather than individual values. Block processing improves query execution speed and throughput when working with time series collections. </p> <p class="leafygreen-ui-1kp3ins"> Block processing significantly improves performance and reduces overhead for long running aggregation pipelines that begin with the following stages: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/match/#mongodb-pipeline-pipe.-match"> <code class="leafygreen-ui-1l06pbn"> $match </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/sort/#mongodb-pipeline-pipe.-sort"> <code class="leafygreen-ui-1l06pbn"> $sort </code> </a> , if used on the <code class="leafygreen-ui-1l06pbn"> timeField </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/group/#mongodb-pipeline-pipe.-group"> <code class="leafygreen-ui-1l06pbn"> $group </code> </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> MongoDB automatically enables block processing for eligible time series queries. You cannot manually specify whether a query uses block processing. </p> <p class="leafygreen-ui-1kp3ins"> To see if your time series query uses block processing, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/explain-results/#mongodb-data-explain.queryPlanner.winningPlan.slotBasedPlan.stages"> <code class="leafygreen-ui-1l06pbn"> stages </code> </a> in the explain plan output. </p> </section> </section>
https://www.mongodb.com/docs/manual/core/indexes/index-types/index-wildcard/reference/restrictions/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Wildcard Index Restrictions <a class="headerlink leafygreen-ui-1kepx47" href="#wildcard-index-restrictions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="wildcard-index-restrictions"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#compound-wildcard-index-restrictions" target="_self"> <span> Compound Wildcard Index Restrictions </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#incompatible-index-properties" target="_self"> <span> Incompatible Index Properties </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#incompatible-index-types" target="_self"> <span> Incompatible Index Types </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#shard-key" target="_self"> <span> Shard Key </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#unsupported-query-patterns" target="_self"> <span> Unsupported Query Patterns </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#array-field-is-not-equal-to-null" target="_self"> <span> Array Field is Not Equal to <code class="css-1kekw28 e1wawog0"> null </code> </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#equality-matches-on-documents-and-arrays" target="_self"> <span> Equality Matches on Documents and Arrays </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#field-does-not-exist" target="_self"> <span> Field Does Not Exist </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#multi-field-query-predicates" target="_self"> <span> Multi-Field Query Predicates </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#queries-with-sort" target="_self"> <span> Queries with Sort </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> This page describes limitations for wildcard indexes such as incompatible properties and unsupported query patterns. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compound Wildcard Index Restrictions <a class="headerlink leafygreen-ui-1kepx47" href="#compound-wildcard-index-restrictions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compound-wildcard-index-restrictions"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-wildcard/index-wildcard-compound/#std-label-wildcard-index-compound"> Compound wildcard indexes </a> have the following restrictions: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A compound wildcard index can only have one wildcard term. </p> <p class="leafygreen-ui-1kp3ins"> For example, you cannot specify the following index: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ userID: 1, \"object1.$**\": 1, \"object2.$**\": 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">userID</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"object1.$**"</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"object2.$**"</span>: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The non-wildcard terms in a <code class="leafygreen-ui-1l06pbn"> compound wildcard index </code> must be single key terms. <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-multikey/#std-label-index-type-multikey"> Multikey </a> index terms are not permitted. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> option is only valid when the wildcard field is <code class="leafygreen-ui-1l06pbn"> $** </code> . You cannot use <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> when you specify a field path for the wildcard index term. </p> <p class="leafygreen-ui-1kp3ins"> This is a valid definition: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n key: { \"$**\": 1 },\n name: \"index_all_with_projection\",\n wildcardProjection: {\n \"someFields.name\": 1,\n \"otherFields.values\": 1\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">key</span>: <!-- -->{ <span class="lg-highlight-string">"$**"</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">"index_all_with_projection"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">wildcardProjection</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"someFields.name"</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"otherFields.values"</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This is an invalid definition: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n key: { \"someFields.$**\": 1 },\n name: \"invalid_index\",\n wildcardProjection: {\n \"someFields.name\": 1,\n \"otherFields.values\": 1\n }\n}"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> key: { "someFields.$**": 1 },</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> name: "invalid_index",</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> wildcardProjection: {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "someFields.name": 1,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "otherFields.values": 1</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> _id </code> field is omitted by default. If you need the <code class="leafygreen-ui-1l06pbn"> _id </code> field: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Specify a wildcard index as <code class="leafygreen-ui-1l06pbn"> $** </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use a <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Specify the <code class="leafygreen-ui-1l06pbn"> _id </code> field </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.studentGrades.createIndex(\n {\n \"$**\": 1,\n },\n {\n wildcardProjection: {\n _id: 1,\n exams: 1,\n extraCredit: 1\n }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">studentGrades</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$**"</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">wildcardProjection</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">exams</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">extraCredit</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot include the same field in the wildcard fields and the regular fields. You can use a <code class="leafygreen-ui-1l06pbn"> wildcardProjection </code> to exclude fields from the wildcard pattern. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.studentGrades.createIndex(\n {\n exams: 1,\n \"$**\": 1,\n homeworks: 1\n },\n {\n wildcardProjection: {\n exams: 0,\n homeworks: 0\n }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">studentGrades</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">exams</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"$**"</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">homeworks</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">wildcardProjection</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">exams</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">homeworks</span>: <span class="lg-highlight-number">0</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Incompatible Index Properties <a class="headerlink leafygreen-ui-1kepx47" href="#incompatible-index-properties" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="incompatible-index-properties"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You cannot specify the following properties for a wildcard index: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-ttl/#std-label-index-feature-ttl"> TTL </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-unique/#std-label-index-type-unique"> Unique </a> </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Incompatible Index Types <a class="headerlink leafygreen-ui-1kepx47" href="#incompatible-index-types" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="incompatible-index-types"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You cannot create the following index types using wildcard syntax ( <code class="leafygreen-ui-1l06pbn"> $.** </code> ): </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index"> 2d (Geospatial) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2dsphere/#std-label-2dsphere-index"> 2dsphere (Geospatial) </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-hashed/#std-label-index-type-hashed"> Hashed </a> </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> Disambiguation </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Wildcard Indexes are distinct from and incompatible with <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/create-wildcard-text-index/#std-label-create-wildcard-text-index"> Create a Wildcard Text Index on Self-Managed Deployments </a> . Wildcard indexes cannot support queries using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/text/#mongodb-query-op.-text"> <code class="leafygreen-ui-1l06pbn"> $text </code> </a> operator. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Shard Key <a class="headerlink leafygreen-ui-1kepx47" href="#shard-key" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="shard-key"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You cannot use a wildcard index as a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-shard-key/#std-label-sharding-shard-key-indexes"> shard key index <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Unsupported Query Patterns <a class="headerlink leafygreen-ui-1kepx47" href="#unsupported-query-patterns" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="unsupported-query-patterns"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Wildcard indexes cannot support the following query patterns: </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Array Field is Not Equal to <code class="leafygreen-ui-1l06pbn"> null </code> <a class="headerlink leafygreen-ui-1kepx47" href="#array-field-is-not-equal-to-null" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="array-field-is-not-equal-to-null"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If a given field is an array in any document in the collection, wildcard indexes cannot support queries for documents where that field is not equal to <code class="leafygreen-ui-1l06pbn"> null </code> . </p> <p class="leafygreen-ui-1kp3ins"> For example, consider an <code class="leafygreen-ui-1l06pbn"> inventory </code> collection with a wildcard index on <code class="leafygreen-ui-1l06pbn"> product_attributes </code> . The wildcard index <strong> cannot </strong> support the following queries if <code class="leafygreen-ui-1l06pbn"> product_attributes.tags </code> is an array in any document in the collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find( { $ne : [ \"product_attributes.tags\", null ] } )\n\ndb.inventory.aggregate( [\n {\n $match : { $ne : [ \"product_attributes.tags\", null ] }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <!-- -->$ne<!-- --> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"product_attributes.tags"</span>, <span class="lg-highlight-literal">null</span> ] } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->$match<!-- --> <!-- -->: <!-- -->{ <!-- -->$ne<!-- --> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"product_attributes.tags"</span>, <span class="lg-highlight-literal">null</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Equality Matches on Documents and Arrays <a class="headerlink leafygreen-ui-1kepx47" href="#equality-matches-on-documents-and-arrays" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="equality-matches-on-documents-and-arrays"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Wildcard indexes store entries for the contents of a document or array, not the document or array itself. Therefore, wildcard indexes cannot support exact equality matches on documents or arrays. </p> <p class="leafygreen-ui-1kp3ins"> For example, consider an <code class="leafygreen-ui-1l06pbn"> inventory </code> collection with a wildcard index on <code class="leafygreen-ui-1l06pbn"> product_attributes </code> . The wildcard index cannot support the following queries: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find(\n {\n \"product_attributes\" : { \"price\" : 29.99 }\n }\n)\n\ndb.inventory.find(\n {\n \"product_attributes.tags\" : [ \"waterproof\", \"fireproof\" ]\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"product_attributes"</span> <!-- -->: <!-- -->{ <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">29.99</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"product_attributes.tags"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"waterproof"</span>, <span class="lg-highlight-string">"fireproof"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Wildcard indexes <strong> can </strong> support queries where the field equals an empty document <code class="leafygreen-ui-1l06pbn"> {} </code> . </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Similarly, wildcard indexes cannot support exact <strong> inequality </strong> matches on documents and arrays. For example, a wildcard index on <code class="leafygreen-ui-1l06pbn"> product_attributes </code> cannot support the following queries: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.aggregate( [\n {\n $match : {\n $ne : [ \"product_attributes\", { \"price\" : 29.99 } ]\n }\n }\n] )\n\ndb.inventory.aggregate( [\n {\n $match : {\n $ne : [ \"product_attributes.tags\", [ \"waterproof\", \"fireproof\" ] ]\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->$match<!-- --> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->$ne<!-- --> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"product_attributes"</span>, <!-- -->{ <span class="lg-highlight-string">"price"</span> <!-- -->: <span class="lg-highlight-number">29.99</span> } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->$match<!-- --> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->$ne<!-- --> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"product_attributes.tags"</span>, <!-- -->[ <span class="lg-highlight-string">"waterproof"</span>, <span class="lg-highlight-string">"fireproof"</span> ] ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Field Does Not Exist <a class="headerlink leafygreen-ui-1kepx47" href="#field-does-not-exist" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="field-does-not-exist"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Wildcard indexes are <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-sparse/#std-label-index-type-sparse"> sparse </a> and do not index empty fields. Therefore, wildcard indexes cannot support queries for documents where a field does not exist. </p> <p class="leafygreen-ui-1kp3ins"> For example, consider an <code class="leafygreen-ui-1l06pbn"> inventory </code> collection with a wildcard index on <code class="leafygreen-ui-1l06pbn"> product_attributes </code> . The wildcard index cannot support the following queries: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find(\n {\n \"product_attributes\" : { $exists : false }\n }\n)\n\ndb.inventory.aggregate( [\n {\n $match : {\n \"product_attributes\" : { $exists : false }\n }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"product_attributes"</span> <!-- -->: <!-- -->{ <!-- -->$exists<!-- --> <!-- -->: <span class="lg-highlight-literal">false</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->$match<!-- --> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"product_attributes"</span> <!-- -->: <!-- -->{ <!-- -->$exists<!-- --> <!-- -->: <span class="lg-highlight-literal">false</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-wildcard-restrictions-multifield-predicate"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Multi-Field Query Predicates <a class="headerlink leafygreen-ui-1kepx47" href="#multi-field-query-predicates" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="multi-field-query-predicates"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Wildcard indexes can support at most <em> one </em> query predicate field. This means that: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MongoDB can't use a non-wildcard index to support one part of a query predicate and a wildcard index to support another. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> MongoDB can't use multiple wildcard indexes to support different predicates in the same query. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> In the case that a single wildcard index could support multiple query fields, MongoDB can only use the wildcard index to support one of the query fields. MongoDB chooses which field to support with the wildcard index automatically based on relevant wildcard index paths. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For example, consider an <code class="leafygreen-ui-1l06pbn"> inventory </code> collection with a wildcard index on <code class="leafygreen-ui-1l06pbn"> product_attributes </code> . The wildcard index cannot support all of the predicates in the following query: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find(\n {\n \"product_attributes.price\": { $gt: 20 },\n \"product_attributes.material\": \"silk\",\n \"product_attributes.size\": \"large\"\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"product_attributes.price"</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">20</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"product_attributes.material"</span>: <span class="lg-highlight-string">"silk"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"product_attributes.size"</span>: <span class="lg-highlight-string">"large"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Instead, MongoDB uses the wildcard index to support only one of the query predicates. MongoDB chooses which predicate to support based on relevant wildcard index paths. The unsupported query predicates are shown in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/explain-results/#mongodb-data-explain.queryPlanner.rejectedPlans"> <code class="leafygreen-ui-1l06pbn"> rejectedPlans </code> </a> of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/explain-results/#std-label-explain-results"> explain results <!-- --> . </a> </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> $or Behavior </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB may use the same wildcard index to support each independent argument of the query <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/or/#mongodb-query-op.-or"> <code class="leafygreen-ui-1l06pbn"> $or </code> </a> or aggregation <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/or/#mongodb-expression-exp.-or"> <code class="leafygreen-ui-1l06pbn"> $or </code> </a> operators. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-wc-index-sort"> </span> <span class="leafygreen-ui-1qnjd6d" id="std-label-wildcard-index-sort"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Queries with Sort <a class="headerlink leafygreen-ui-1kepx47" href="#queries-with-sort" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="queries-with-sort"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB can use a wildcard index for satisfying the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.sort/#mongodb-method-cursor.sort"> <code class="leafygreen-ui-1l06pbn"> sort() </code> </a> <strong> only if </strong> all of the following are true: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The query planner selects the wildcard index for satisfying the query predicate. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.sort/#mongodb-method-cursor.sort"> <code class="leafygreen-ui-1l06pbn"> sort() </code> </a> specifies <strong> only </strong> the query predicate field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The specified field is never an array. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If the above conditions are not met, MongoDB cannot use the wildcard index for the sort. MongoDB does not support <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.sort/#mongodb-method-cursor.sort"> <code class="leafygreen-ui-1l06pbn"> sort() </code> </a> operations that require a different index from that of the query predicate. </p> <p class="leafygreen-ui-1kp3ins"> Consider the following wildcard index on the <code class="leafygreen-ui-1l06pbn"> products </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products.createIndex( { \"product_attributes.$**\" : 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-string">"product_attributes.$**"</span> <!-- -->: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation queries for a single field <code class="leafygreen-ui-1l06pbn"> product_attributes.price </code> and sorts on that same field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.products.find(\n { \"product_attributes.price\" : { $gt : 10.00 } },\n).sort(\n { \"product_attributes.price\" : 1 }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">products</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"product_attributes.price"</span> <!-- -->: <!-- -->{ <!-- -->$gt<!-- --> <!-- -->: <span class="lg-highlight-number">10.00</span> } }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">).<span class="lg-highlight-title lg-highlight-function">sort</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"product_attributes.price"</span> <!-- -->: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Assuming that the specified <code class="leafygreen-ui-1l06pbn"> price </code> is never an array, MongoDB can use the <code class="leafygreen-ui-1l06pbn"> product_attributes.$** </code> wildcard index for satisfying both the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find() </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.sort/#mongodb-method-cursor.sort"> <code class="leafygreen-ui-1l06pbn"> sort() </code> . </a> </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/core/sharding-choose-a-shard-key/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Choose a Shard Key <a class="headerlink leafygreen-ui-1kepx47" href="#choose-a-shard-key" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="choose-a-shard-key"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#shard-key-cardinality" target="_self"> <span> Shard Key Cardinality </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#shard-key-frequency" target="_self"> <span> Shard Key Frequency </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#monotonically-changing-shard-keys" target="_self"> <span> Monotonically Changing Shard Keys </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#sharding-query-patterns" target="_self"> <span> Sharding Query Patterns </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#use-shard-key-analyzer-in-7.0-to-find-your-shard-key" target="_self"> <span> Use Shard Key Analyzer in 7.0 to Find Your Shard Key </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#enable-query-sampling" target="_self"> <span> Enable Query Sampling </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#shard-key-analysis-commands" target="_self"> <span> Shard Key Analysis Commands </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> The choice of shard key affects the creation and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-balancer-administration/#std-label-sharding-balancing"> distribution of chunks </a> across the available <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard"> shards </a> . The distribution of data affects the efficiency and performance of operations within the sharded cluster. </p> <p class="leafygreen-ui-1kp3ins"> The ideal shard key allows MongoDB to distribute documents evenly throughout the cluster while also facilitating common query patterns. </p> <p class="leafygreen-ui-1kp3ins"> When you choose your shard key, consider: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-shard-key-range" target="_self"> <span> cardinality </span> </a> of the shard key </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-shard-key-frequency" target="_self"> <span> frequency </span> </a> with which shard key values occur </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> whether a potential shard key grows <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-shard-key-monotonic" target="_self"> <span> monotonically </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-sharding-query-patterns" target="_self"> <span> Sharding Query Patterns </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/limits/#std-label-limits-shard-keys"> Shard Key Limitations </a> </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, you can <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-reshard-a-collection/#std-label-sharding-resharding"> change your shard key </a> and redistribute your data using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/reshardCollection/#mongodb-dbcommand-dbcmd.reshardCollection"> <code class="leafygreen-ui-1l06pbn"> reshardCollection </code> </a> command. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/refineCollectionShardKey/#mongodb-dbcommand-dbcmd.refineCollectionShardKey"> <code class="leafygreen-ui-1l06pbn"> refineCollectionShardKey </code> </a> command to refine a collection's shard key. The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/refineCollectionShardKey/#mongodb-dbcommand-dbcmd.refineCollectionShardKey"> <code class="leafygreen-ui-1l06pbn"> refineCollectionShardKey </code> </a> command adds a suffix field or fields to the existing key to create the new shard key. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can update a document's shard key value unless the shard key field is the immutable <code class="leafygreen-ui-1l06pbn"> _id </code> field. </p> </li> </ul> </div> </div> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If you regularly change a document's shard key value so that the value is in a shard key range owned by a different shard, it may impact cluster performance due to the additional resources involved in migrating the document between shards. For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-data-partitioning/#std-label-sharding-data-partitioning"> Data Partitioning with Chunks </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#std-label-updateOne-shard-key-modification"> db.collection.updateOne() <!-- --> . </a> </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-shard-key-range"> </span> <span class="leafygreen-ui-1qnjd6d" id="std-label-sharding-shard-key-cardinality"> </span> <span class="leafygreen-ui-1qnjd6d" id="std-label-shard-key-cardinality"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Shard Key Cardinality <a class="headerlink leafygreen-ui-1kepx47" href="#shard-key-cardinality" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="shard-key-cardinality"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-cardinality"> cardinality </a> of a shard key determines the maximum number of chunks the balancer can create. Where possible, choose a shard key with high cardinality. A shard key with low cardinality reduces the effectiveness of horizontal scaling in the cluster. </p> <p class="leafygreen-ui-1kp3ins"> Each unique shard key value can exist on no more than a single chunk at any given time. Consider a dataset that contains user data with a <code class="leafygreen-ui-1l06pbn"> continent </code> field. If you chose to shard on <code class="leafygreen-ui-1l06pbn"> continent </code> , the shard key would have a cardinality of <code class="leafygreen-ui-1l06pbn"> 7 </code> . A cardinality of <code class="leafygreen-ui-1l06pbn"> 7 </code> means there can be no more than <code class="leafygreen-ui-1l06pbn"> 7 </code> chunks within the sharded cluster, each storing one unique shard key value. This constrains the number of effective shards in the cluster to <code class="leafygreen-ui-1l06pbn"> 7 </code> as well - adding more than seven shards would not provide any benefit. </p> <p class="leafygreen-ui-1kp3ins"> The following image illustrates a sharded cluster using the field <code class="leafygreen-ui-1l06pbn"> X </code> as the shard key. If <code class="leafygreen-ui-1l06pbn"> X </code> has low cardinality, the distribution of inserts may look similar to the following: </p> <div class="css-y1v7l ej97su30"> <div role="button" tabindex="-1"> <img alt="Diagram of poor shard key distribution due to low cardinality" class="leafygreen-ui-1qnf57e" height="600" src="/docs/manual/images/sharded-cluster-ranged-distribution-low-cardinal.bakedsvg.svg" style="--border-color:#C1C7C6" width="1200"/> <div class="css-19pi7x2 ej97su31" style="--color:#444"> click to enlarge </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If your data model requires sharding on a key that has low cardinality, consider using an indexed <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-compound-index"> compound </a> of fields to increase cardinality. </p> <p class="leafygreen-ui-1kp3ins"> A shard key with high cardinality does not, on its own, guarantee even distribution of data across the sharded cluster. The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-shard-key-frequency" target="_self"> <span> frequency </span> </a> of the shard key and the potential for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-shard-key-monotonic" target="_self"> <span> monotonically changing shard key values </span> </a> also contribute to the distribution of the data. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-shard-key-frequency"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Shard Key Frequency <a class="headerlink leafygreen-ui-1kepx47" href="#shard-key-frequency" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="shard-key-frequency"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> frequency </code> of the shard key represents how often a given shard key value occurs in the data. If the majority of documents contain only a subset of the possible shard key values, then the chunks storing the documents with those values can become a bottleneck within the cluster. Furthermore, as those chunks grow, they may become <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-data-partitioning/#std-label-jumbo-chunks"> indivisible chunks </a> as they cannot be split any further. This reduces the effectiveness of horizontal scaling within the cluster. </p> <p class="leafygreen-ui-1kp3ins"> The following image illustrates a sharded cluster using the field <code class="leafygreen-ui-1l06pbn"> X </code> as the shard key. If a subset of values for <code class="leafygreen-ui-1l06pbn"> X </code> occur with high frequency, the distribution of inserts may look similar to the following: </p> <div class="css-y1v7l ej97su30"> <div role="button" tabindex="-1"> <img alt="Diagram of poor shard key distribution due to high frequency" class="leafygreen-ui-1qnf57e" height="600" src="/docs/manual/images/sharded-cluster-ranged-distribution-frequency.bakedsvg.svg" style="--border-color:#C1C7C6" width="1200"/> <div class="css-19pi7x2 ej97su31" style="--color:#444"> click to enlarge </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If your data model requires sharding on a key that has high frequency values, consider using a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-compound-index"> compound index </a> using a unique or low frequency value. </p> <p class="leafygreen-ui-1kp3ins"> A shard key with low frequency does not, on its own, guarantee even distribution of data across the sharded cluster. The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-shard-key-cardinality" target="_self"> <span> cardinality </span> </a> of the shard key and the potential for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-shard-key-monotonic" target="_self"> <span> monotonically changing shard key values </span> </a> also contribute to the distribution of the data. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-shard-key-monotonic"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Monotonically Changing Shard Keys <a class="headerlink leafygreen-ui-1kepx47" href="#monotonically-changing-shard-keys" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="monotonically-changing-shard-keys"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A shard key on a value that increases or decreases monotonically is more likely to distribute inserts to a single chunk within the cluster. </p> <p class="leafygreen-ui-1kp3ins"> This occurs because every cluster has a chunk that captures a range with an upper bound of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-MaxKey"> <code class="leafygreen-ui-1l06pbn"> MaxKey </code> </a> . <code class="leafygreen-ui-1l06pbn"> maxKey </code> always compares as higher than all other values. Similarly, there is a chunk that captures a range with a lower bound of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-MinKey"> <code class="leafygreen-ui-1l06pbn"> MinKey </code> </a> . <code class="leafygreen-ui-1l06pbn"> minKey </code> always compares as lower than all other values. </p> <p class="leafygreen-ui-1kp3ins"> If the shard key value is always increasing, all new inserts are routed to the chunk with <code class="leafygreen-ui-1l06pbn"> maxKey </code> as the upper bound. If the shard key value is always decreasing, all new inserts are routed to the chunk with <code class="leafygreen-ui-1l06pbn"> minKey </code> as the lower bound. The shard containing that chunk becomes the bottleneck for write operations. </p> <p class="leafygreen-ui-1kp3ins"> To optimize data distribution, the chunks that contain the global <code class="leafygreen-ui-1l06pbn"> maxKey </code> (or <code class="leafygreen-ui-1l06pbn"> minKey </code> ) do not stay on the same shard. When a chunk is split, the new chunk with the <code class="leafygreen-ui-1l06pbn"> maxKey </code> (or <code class="leafygreen-ui-1l06pbn"> minKey </code> ) chunk is located on a different shard. </p> <p class="leafygreen-ui-1kp3ins"> The following image illustrates a sharded cluster using the field <code class="leafygreen-ui-1l06pbn"> X </code> as the shard key. If the values for <code class="leafygreen-ui-1l06pbn"> X </code> are monotonically increasing, the distribution of inserts may look similar to the following: </p> <div class="css-y1v7l ej97su30"> <div role="button" tabindex="-1"> <img alt="Diagram of poor shard key distribution due to monotonically increasing or decreasing shard key" class="leafygreen-ui-1qnf57e" height="600" src="/docs/manual/images/sharded-cluster-monotonic-distribution.bakedsvg.svg" style="--border-color:#C1C7C6" width="1200"/> <div class="css-19pi7x2 ej97su31" style="--color:#444"> click to enlarge </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If the shard key value was monotonically decreasing, then all inserts would route to <code class="leafygreen-ui-1l06pbn"> Chunk A </code> instead. </p> <p class="leafygreen-ui-1kp3ins"> If your data model requires sharding on a key that changes monotonically, consider using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/hashed-sharding/"> Hashed Sharding <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> A shard key that does not change monotonically does not, on its own, guarantee even distribution of data across the sharded cluster. The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-shard-key-cardinality" target="_self"> <span> cardinality </span> </a> and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-shard-key-frequency" target="_self"> <span> frequency </span> </a> of the shard key also contribute to the distribution of the data. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-sharding-query-patterns"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Sharding Query Patterns <a class="headerlink leafygreen-ui-1kepx47" href="#sharding-query-patterns" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sharding-query-patterns"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The ideal shard key distributes data evenly across the sharded cluster while also facilitating common query patterns. When you choose a shard key, consider your most common query patterns and whether a given shard key covers them. </p> <p class="leafygreen-ui-1kp3ins"> In a sharded cluster, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> routes queries to only the shards that contain the relevant data if the queries contain the shard key. When the queries do not contain the shard key, the queries are broadcast to all shards for evaluation. These types of queries are called scatter-gather queries. Queries that involve multiple shards for each request are less efficient and do not scale linearly when more shards are added to the cluster. </p> <p class="leafygreen-ui-1kp3ins"> This does not apply for aggregation queries that operate on a large amount of data. In these cases, scatter-gather can be a useful approach that allows the query to run in parallel on all shards. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Use Shard Key Analyzer in 7.0 to Find Your Shard Key <a class="headerlink leafygreen-ui-1kepx47" href="#use-shard-key-analyzer-in-7.0-to-find-your-shard-key" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-shard-key-analyzer-in-7.0-to-find-your-shard-key"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in 7.0, MongoDB makes it easier to choose your shard key. You can use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/analyzeShardKey/#mongodb-dbcommand-dbcmd.analyzeShardKey"> <code class="leafygreen-ui-1l06pbn"> analyzeShardKey </code> </a> which calculates metrics for evaluating a shard key for an unsharded or sharded collection. Metrics are based on sampled queries, allowing you to make a data-driven choice for your shard key. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Enable Query Sampling <a class="headerlink leafygreen-ui-1kepx47" href="#enable-query-sampling" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="enable-query-sampling"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To analyze a shard key, you must enable query sampling on the target collection. For more information, see: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/configureQueryAnalyzer/#mongodb-dbcommand-dbcmd.configureQueryAnalyzer"> <code class="leafygreen-ui-1l06pbn"> configureQueryAnalyzer </code> </a> database command </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.configureQueryAnalyzer/#mongodb-method-db.collection.configureQueryAnalyzer"> <code class="leafygreen-ui-1l06pbn"> db.collection.configureQueryAnalyzer() </code> </a> shell method </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> To monitor the query sampling process, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/currentOp/#mongodb-pipeline-pipe.-currentOp"> <code class="leafygreen-ui-1l06pbn"> $currentOp </code> </a> stage. For an example, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/currentOp/#std-label-sampled-queries-currentOp-stage"> Sampled Queries <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Shard Key Analysis Commands <a class="headerlink leafygreen-ui-1kepx47" href="#shard-key-analysis-commands" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="shard-key-analysis-commands"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To analyze a shard key, see: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/analyzeShardKey/#mongodb-dbcommand-dbcmd.analyzeShardKey"> <code class="leafygreen-ui-1l06pbn"> analyzeShardKey </code> </a> database command </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.analyzeShardKey/#mongodb-method-db.collection.analyzeShardKey"> <code class="leafygreen-ui-1l06pbn"> db.collection.analyzeShardKey() </code> </a> shell method </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> analyzeShardKey </code> returns metrics about key characteristics of a shard key and its read and write distribution. The metrics are based on sampled queries. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> keyCharacteristics </code> field contains metrics about the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-shard-key-cardinality" target="_self"> <span> cardinality </span> </a> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-shard-key-frequency" target="_self"> <span> frequency </span> </a> , and <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-shard-key-monotonic" target="_self"> <span> monotonicity </span> </a> of the shard key. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> readWriteDistribution </code> field contains metrics about the query routing patterns and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-troubleshooting-shard-keys/#std-label-sharding-troubleshooting-monotonicity"> load distribution </a> of shard key ranges. </p> </li> </ul> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/distributed-queries/#std-label-read-operations-sharded-clusters"> Read Operations to Sharded Clusters </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-query-router/#std-label-sharding-query-router-broadcast-targeted"> Targeted Operations vs. Broadcast Operations </a> </p> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/transitionToDedicatedConfigServer/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> transitionToDedicatedConfigServer <a class="headerlink leafygreen-ui-1kepx47" href="#transitiontodedicatedconfigserver" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="transitiontodedicatedconfigserver"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#access-control" target="_self"> <span> Access Control </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self"> <span> Learn More </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.transitionToDedicatedConfigServer" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-dbcommand-dbcmd.transitionToDedicatedConfigServer"> </div> </a> </dt> <dd> </dd> </dl> <div> <p> <em> New <!-- --> in version <!-- --> 8.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, you can: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Configure a config server to store your application data in addition to the usual <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-sharded-cluster"> sharded cluster </a> metadata. A config server that stores application data is called a <em> config shard </em> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Transition a config server between being a config shard and a dedicated config server. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> A cluster requires a config server, but it can be a config shard instead of a dedicated config server. Using a config shard reduces the number of nodes required and can simplify your deployment. </p> <p class="leafygreen-ui-1kp3ins"> If your application has demanding availability and resiliency requirements, consider deploying a dedicated config server. A dedicated config server provides isolation, dedicated resources, and consistent performance for critical cluster operations. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> command configures a config shard to run as a dedicated config server. The command causes the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-balancer"> balancer </a> to prioritize moving the chunks from the config shard to other shards in the cluster. </p> <p class="leafygreen-ui-1kp3ins"> Before you run <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> , connect to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> and use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-admin-database"> admin database <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The sharded cluster must have <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-view-fcv"> featureCompatibilityVersion </a> set to at least <code class="leafygreen-ui-1l06pbn"> 8.0 </code> . </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Command syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( {\n transitionToDedicatedConfigServer: 1\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">transitionToDedicatedConfigServer</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> command moves application data from the config shard to the other shards in the cluster in the same way that the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/removeShard/#mongodb-dbcommand-dbcmd.removeShard"> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </a> command moves data. </p> <p class="leafygreen-ui-1kp3ins"> Internally, <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> runs the <code class="leafygreen-ui-1l06pbn"> removeShard </code> command. <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> returns the same response as <code class="leafygreen-ui-1l06pbn"> removeShard </code> . The response after a successful data move contains <code class="leafygreen-ui-1l06pbn"> state: "completed" </code> . For full response details and examples, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/removeShard/#std-label-removeShard-examples"> removeShard Example </a> . Review the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/removeShard/#mongodb-dbcommand-dbcmd.removeShard"> <code class="leafygreen-ui-1l06pbn"> removeShard </code> </a> documentation before running <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> to understand how it may affect your deployment. </p> <p class="leafygreen-ui-1kp3ins"> If you run <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> twice and the shard data is currently moving to other shards, the second run of <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> returns the current status of the data move. <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> returns the same response as <code class="leafygreen-ui-1l06pbn"> removeShard </code> . </p> <p class="leafygreen-ui-1kp3ins"> After <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> completes the data move, the config server is a dedicated config server and is no longer a config shard. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Access Control <a class="headerlink leafygreen-ui-1kepx47" href="#access-control" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="access-control"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If access control is enabled, the <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> command requires the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-transitionToDedicatedConfigServer"> <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> </a> authorization action for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/resource-document/#std-label-resource-document"> cluster <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n resource: { cluster : true },\n actions: [ \"transitionToDedicatedConfigServer\" ]\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">resource</span>: <!-- -->{ <!-- -->cluster <!-- -->: <span class="lg-highlight-literal">true</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">actions</span>: <!-- -->[ <span class="lg-highlight-string">"transitionToDedicatedConfigServer"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-clusterManager"> <code class="leafygreen-ui-1l06pbn"> clusterManager </code> </a> role has <code class="leafygreen-ui-1l06pbn"> transitionToDedicatedConfigServer </code> authorization action and can be assigned to a user. </p> <p class="leafygreen-ui-1kp3ins"> The following example assigns the <code class="leafygreen-ui-1l06pbn"> clusterManager </code> role to a user named <code class="leafygreen-ui-1l06pbn"> testUser </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.grantRolesToUser(\n \"testUser\",\n [ \"clusterManager\" ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">grantRolesToUser</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"testUser"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[ <span class="lg-highlight-string">"clusterManager"</span> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example configures a config shard to run as a dedicated config server: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( {\n transitionToDedicatedConfigServer: 1\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">transitionToDedicatedConfigServer</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For details, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-config-servers/#std-label-sharded-cluster-config-server-config-shards-downgrade"> Downgrade Feature Compatibility Version <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-config-servers/#std-label-sharded-cluster-config-server-config-shards"> Config Shards </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-users-and-roles/#std-label-modify-existing-user-access"> Modify Access for an Existing User </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/setDifference/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $setDifference (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-setdifference--aggregation-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-setdifference--aggregation-"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $setDifference </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-setDifference" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-expression-exp.-setDifference"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Takes two sets and returns an array containing the elements that only exist in the first set; i.e. performs a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://en.wikipedia.org/wiki/Complement_(set_theory)" rel="noopener noreferrer"> <span> relative complement </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> of the second set relative to the first. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-setDifference" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setDifference </code> </span> </a> has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $setDifference: [ &lt;expression1&gt;, &lt;expression2&gt; ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$setDifference</span>: <!-- -->[ &lt;<!-- -->expression1<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->expression2<!-- -->&gt; <!-- -->] }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The arguments can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> as long as they each resolve to an array. For more information on expressions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> Expression Operators <!-- --> . </a> </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-setDifference" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setDifference </code> </span> </a> performs set operation on arrays, treating arrays as sets. If an array contains duplicate entries, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-setDifference" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setDifference </code> </span> </a> ignores the duplicate entries. <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-setDifference" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setDifference </code> </span> </a> ignores the order of the elements. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-setDifference" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setDifference </code> </span> </a> filters out duplicates in its result to output an array that contain only unique entries. The order of the elements in the output array is unspecified. </p> <p class="leafygreen-ui-1kp3ins"> If a set contains a nested array element, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-setDifference" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setDifference </code> </span> </a> does <em> not </em> descend into the nested array but evaluates the array at top-level. </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:80%"/> <col style="width:20%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Result </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $setDifference: [ [ \"a\", \"b\", \"a\" ], [ \"b\", \"a\" ] ] }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1agdxuk" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$setDifference</span>: <!-- -->[ <!-- -->[ <span class="lg-highlight-string">"a"</span>, <span class="lg-highlight-string">"b"</span>, <span class="lg-highlight-string">"a"</span> ]<!-- -->, <!-- -->[ <span class="lg-highlight-string">"b"</span>, <span class="lg-highlight-string">"a"</span> ] ] }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[ ]","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ <!-- -->]</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $setDifference: [ [ \"a\", \"b\" ], [ [ \"a\", \"b\" ] ] ] }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1agdxuk" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$setDifference</span>: <!-- -->[ <!-- -->[ <span class="lg-highlight-string">"a"</span>, <span class="lg-highlight-string">"b"</span> ]<!-- -->, <!-- -->[ <!-- -->[ <span class="lg-highlight-string">"a"</span>, <span class="lg-highlight-string">"b"</span> ] ] ] }</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[ \"a\", \"b\" ]","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ <span class="lg-highlight-string">"a"</span>, <span class="lg-highlight-string">"b"</span> ]</td></tr></tbody></table></code></pre> </div> </div> </div> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Consider an <code class="leafygreen-ui-1l06pbn"> flowers </code> collection with the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.flowers.insertMany( [\n { \"_id\" : 1, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"rose\", \"orchid\" ] },\n { \"_id\" : 2, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"orchid\", \"rose\", \"orchid\" ] },\n { \"_id\" : 3, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"rose\", \"orchid\", \"jasmine\" ] },\n { \"_id\" : 4, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"jasmine\", \"rose\" ] },\n { \"_id\" : 5, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ ] },\n { \"_id\" : 6, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ [ \"rose\" ], [ \"orchid\" ] ] },\n { \"_id\" : 7, \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ [ \"rose\", \"orchid\" ] ] },\n { \"_id\" : 8, \"flowerFieldA\" : [ ], \"flowerFieldB\" : [ ] },\n { \"_id\" : 9, \"flowerFieldA\" : [ ], \"flowerFieldB\" : [ \"rose\" ] }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">flowers</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"orchid"</span>, <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span>, <span class="lg-highlight-string">"jasmine"</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">4</span>, <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"jasmine"</span>, <span class="lg-highlight-string">"rose"</span> ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <!-- -->] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">6</span>, <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <!-- -->[ <span class="lg-highlight-string">"rose"</span> ]<!-- -->, <!-- -->[ <span class="lg-highlight-string">"orchid"</span> ] ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">7</span>, <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ] ] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">8</span>, <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <!-- -->]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <!-- -->] }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">9</span>, <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <!-- -->]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation uses the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-setDifference" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $setDifference </code> </span> </a> operator to return an array of elements found in the <code class="leafygreen-ui-1l06pbn"> flowerFieldB </code> array but <em> not </em> in the <code class="leafygreen-ui-1l06pbn"> flowerFieldA </code> array: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.flowers.aggregate(\n [\n { $project: { flowerFieldA: 1, flowerFieldB: 1, inBOnly: { $setDifference: [ \"$flowerFieldB\", \"$flowerFieldA\" ] }, _id: 0 } }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">flowers</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">$project</span>: <!-- -->{ <span class="lg-highlight-attr">flowerFieldA</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">flowerFieldB</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">inBOnly</span>: <!-- -->{ <span class="lg-highlight-attr">$setDifference</span>: <!-- -->[ <span class="lg-highlight-string">"$flowerFieldB"</span>, <span class="lg-highlight-string">"$flowerFieldA"</span> ] }<!-- -->, <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"rose\", \"orchid\" ], \"inBOnly\" : [ ] }\n{ \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"orchid\", \"rose\", \"orchid\" ], \"inBOnly\" : [ ] }\n{ \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"rose\", \"orchid\", \"jasmine\" ], \"inBOnly\" : [ \"jasmine\" ] }\n{ \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ \"jasmine\", \"rose\" ], \"inBOnly\" : [ \"jasmine\" ] }\n{ \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ ], \"inBOnly\" : [ ] }\n{ \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ [ \"rose\" ], [ \"orchid\" ] ], \"inBOnly\" : [ [ \"rose\" ], [ \"orchid\" ] ] }\n{ \"flowerFieldA\" : [ \"rose\", \"orchid\" ], \"flowerFieldB\" : [ [ \"rose\", \"orchid\" ] ], \"inBOnly\" : [ [ \"rose\", \"orchid\" ] ] }\n{ \"flowerFieldA\" : [ ], \"flowerFieldB\" : [ ], \"inBOnly\" : [ ] }\n{ \"flowerFieldA\" : [ ], \"flowerFieldB\" : [ \"rose\" ], \"inBOnly\" : [ \"rose\" ] }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"inBOnly"</span> <!-- -->: <!-- -->[ <!-- -->] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"orchid"</span>, <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"inBOnly"</span> <!-- -->: <!-- -->[ <!-- -->] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span>, <span class="lg-highlight-string">"jasmine"</span> ]<!-- -->, <span class="lg-highlight-string">"inBOnly"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"jasmine"</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"jasmine"</span>, <span class="lg-highlight-string">"rose"</span> ]<!-- -->, <span class="lg-highlight-string">"inBOnly"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"jasmine"</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <!-- -->]<!-- -->, <span class="lg-highlight-string">"inBOnly"</span> <!-- -->: <!-- -->[ <!-- -->] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <!-- -->[ <span class="lg-highlight-string">"rose"</span> ]<!-- -->, <!-- -->[ <span class="lg-highlight-string">"orchid"</span> ] ]<!-- -->, <span class="lg-highlight-string">"inBOnly"</span> <!-- -->: <!-- -->[ <!-- -->[ <span class="lg-highlight-string">"rose"</span> ]<!-- -->, <!-- -->[ <span class="lg-highlight-string">"orchid"</span> ] ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ] ]<!-- -->, <span class="lg-highlight-string">"inBOnly"</span> <!-- -->: <!-- -->[ <!-- -->[ <span class="lg-highlight-string">"rose"</span>, <span class="lg-highlight-string">"orchid"</span> ] ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <!-- -->]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <!-- -->]<!-- -->, <span class="lg-highlight-string">"inBOnly"</span> <!-- -->: <!-- -->[ <!-- -->] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"flowerFieldA"</span> <!-- -->: <!-- -->[ <!-- -->]<!-- -->, <span class="lg-highlight-string">"flowerFieldB"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span> ]<!-- -->, <span class="lg-highlight-string">"inBOnly"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-string">"rose"</span> ] }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/write-concern/write-lifecycle/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Write Lifecycle Diagrams <a class="headerlink leafygreen-ui-1kepx47" href="#write-lifecycle-diagrams" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="write-lifecycle-diagrams"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#write-lifecycle-on-a-primary-member" target="_self"> <span> Write Lifecycle on a Primary Member </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#write-lifecycle-on-a-secondary-member" target="_self"> <span> Write Lifecycle on a Secondary Member </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> These diagrams show the lifecycle of a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/findAndModify/#mongodb-dbcommand-dbcmd.findAndModify"> <code class="leafygreen-ui-1l06pbn"> findAndModify </code> </a> operation on primary and secondary replica set members. The lifecycles of other write commands are similar, but the number of resulting oplog entries may vary. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Write Lifecycle on a Primary Member <a class="headerlink leafygreen-ui-1kepx47" href="#write-lifecycle-on-a-primary-member" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="write-lifecycle-on-a-primary-member"> </div> </a> </h2> <div class="css-20g5si ej97su30"> <div role="button" tabindex="-1"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:1931px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='1571.0000000000002'%20width='1931'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Lifecycle of a findAndModify command on a primary member" data-main-image="" decoding="async" height="1571.0000000000002" loading="lazy" sizes="(min-width: 1931px) 1931px, 100vw" src="/docs/manual/static/e3934326b4e083dd059a42ed204e1747/496ca/write-lifecycle-primary-7-0.webp" srcset="/docs/manual/static/e3934326b4e083dd059a42ed204e1747/5d496/write-lifecycle-primary-7-0.webp 483w,/docs/manual/static/e3934326b4e083dd059a42ed204e1747/2e092/write-lifecycle-primary-7-0.webp 966w,/docs/manual/static/e3934326b4e083dd059a42ed204e1747/496ca/write-lifecycle-primary-7-0.webp 1931w" style="--border-color:#C1C7C6;opacity:0" width="1931"/> <noscript> <img alt="Lifecycle of a findAndModify command on a primary member" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="1571.0000000000002" loading="lazy" sizes="(min-width: 1931px) 1931px, 100vw" src="/docs/manual/static/e3934326b4e083dd059a42ed204e1747/496ca/write-lifecycle-primary-7-0.webp" srcset="/docs/manual/static/e3934326b4e083dd059a42ed204e1747/5d496/write-lifecycle-primary-7-0.webp 483w,/docs/manual/static/e3934326b4e083dd059a42ed204e1747/2e092/write-lifecycle-primary-7-0.webp 966w,/docs/manual/static/e3934326b4e083dd059a42ed204e1747/496ca/write-lifecycle-primary-7-0.webp 1931w" style="--border-color:#C1C7C6;opacity:0" width="1931"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> <div class="css-19pi7x2 ej97su31" style="--color:#444"> click to enlarge </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Write Lifecycle on a Secondary Member <a class="headerlink leafygreen-ui-1kepx47" href="#write-lifecycle-on-a-secondary-member" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="write-lifecycle-on-a-secondary-member"> </div> </a> </h2> <div class="css-20g5si ej97su30"> <div role="button" tabindex="-1"> <div class="gatsby-image-wrapper gatsby-image-wrapper-constrained leafygreen-ui-12xaq6r" data-gatsby-image-wrapper=""> <div style="max-width:1398px;display:block"> <img alt="" aria-hidden="true" role="presentation" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='1546'%20width='1398'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width:100%;display:block;position:static"/> </div> <div aria-hidden="true" data-placeholder-image="" style="opacity:1;transition:opacity 500ms linear"> </div> <img alt="Lifecycle of a findAndModify command on a secondary member" data-main-image="" decoding="async" height="1546" loading="lazy" sizes="(min-width: 1398px) 1398px, 100vw" src="/docs/manual/static/51aff7e95d9cb14be237dcdd4c3f54e3/568a2/write-lifecycle-secondary-7-0.webp" srcset="/docs/manual/static/51aff7e95d9cb14be237dcdd4c3f54e3/e5ef3/write-lifecycle-secondary-7-0.webp 350w,/docs/manual/static/51aff7e95d9cb14be237dcdd4c3f54e3/f43c2/write-lifecycle-secondary-7-0.webp 699w,/docs/manual/static/51aff7e95d9cb14be237dcdd4c3f54e3/568a2/write-lifecycle-secondary-7-0.webp 1398w" style="--border-color:#C1C7C6;opacity:0" width="1398"/> <noscript> <img alt="Lifecycle of a findAndModify command on a secondary member" data-gatsby-image-ssr="" data-main-image="" decoding="async" height="1546" loading="lazy" sizes="(min-width: 1398px) 1398px, 100vw" src="/docs/manual/static/51aff7e95d9cb14be237dcdd4c3f54e3/568a2/write-lifecycle-secondary-7-0.webp" srcset="/docs/manual/static/51aff7e95d9cb14be237dcdd4c3f54e3/e5ef3/write-lifecycle-secondary-7-0.webp 350w,/docs/manual/static/51aff7e95d9cb14be237dcdd4c3f54e3/f43c2/write-lifecycle-secondary-7-0.webp 699w,/docs/manual/static/51aff7e95d9cb14be237dcdd4c3f54e3/568a2/write-lifecycle-secondary-7-0.webp 1398w" style="--border-color:#C1C7C6;opacity:0" width="1398"/> </noscript> <script type="module"> const t="undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;if(t){const t=document.querySelectorAll("img[data-main-image]");for(let e of t){e.dataset.src&&(e.setAttribute("src",e.dataset.src),e.removeAttribute("data-src")),e.dataset.srcset&&(e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset"));const t=e.parentNode.querySelectorAll("source[data-srcset]");for(let e of t)e.setAttribute("srcset",e.dataset.srcset),e.removeAttribute("data-srcset");e.complete&&(e.style.opacity=1,e.parentNode.parentNode.querySelector("[data-placeholder-image]").style.opacity=0)}} </script> </div> <div class="css-19pi7x2 ej97su31" style="--color:#444"> click to enlarge </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/core/queryable-encryption/reference/limitations/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Queryable Encryption Limitations <a class="headerlink leafygreen-ui-1kepx47" href="#queryable-encryption-limitations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="queryable-encryption-limitations"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#overview" target="_self"> <span> Overview </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#security-guarantees" target="_self"> <span> Security Guarantees </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#mongodb-support-limitations" target="_self"> <span> MongoDB Support Limitations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#supported-operations" target="_self"> <span> Supported Operations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#manual-metadata-collection-compaction" target="_self"> <span> Manual Metadata Collection Compaction </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#modifying-the-encryptedfieldsmap" target="_self"> <span> Modifying the <code class="css-1kekw28 e1wawog0"> encryptedFieldsMap </code> </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#the-_id-field" target="_self"> <span> The _id Field </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#encrypted-field-names" target="_self"> <span> Encrypted Field Names </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#modifying-queryable-fields" target="_self"> <span> Modifying Queryable Fields </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#redaction" target="_self"> <span> Redaction </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#query-log-and-database-profiler-redaction" target="_self"> <span> Query Log and Database Profiler Redaction </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#command-and-aggregation-stage-output-redaction" target="_self"> <span> Command and Aggregation Stage Output Redaction </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#topology-support" target="_self"> <span> Topology Support </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#sharding" target="_self"> <span> Sharding </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#collections" target="_self"> <span> Collections </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#drop-collection" target="_self"> <span> Drop Collection </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#create-collection" target="_self"> <span> Create Collection </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#arrays" target="_self"> <span> Arrays </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#views" target="_self"> <span> Views </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#collation" target="_self"> <span> Collation </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#unique-indexes" target="_self"> <span> Unique Indexes </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Overview <a class="headerlink leafygreen-ui-1kepx47" href="#overview" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="overview"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Consider these limitations and restrictions before enabling Queryable Encryption. Some operations are unsupported, and others behave differently. </p> <p class="leafygreen-ui-1kp3ins"> For compatibility limitations, please read <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/compatibility/#std-label-qe-csfle-compatibility"> Compatibility <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Security Guarantees <a class="headerlink leafygreen-ui-1kepx47" href="#security-guarantees" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="security-guarantees"> </div> </a> </h2> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption defends against data exfiltration, not against adversaries with persistent access to an environment, or those who can retrieve both database snapshots and accompanying query transcripts/logs. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> When using Queryable Encryption, equality and range queries offer similar security against attackers with database snapshots. However, an attacker with access to both database snapshots and query information is beyond the scope of Queryable Encryption's security guarantees. This is <strong> especially </strong> true for range queries, even if only a small number of query transcripts or logs are retrieved. See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://cdn.bfldr.com/2URK6TO/as/64kp46t53v34xw37gkngbrg/An_Overview_of_Queryable_Encryption" rel="noopener noreferrer"> <span> 6.1: Range Queries in the Persistent Model </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> in the overview whitepaper for details. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> MongoDB Support Limitations <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-support-limitations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-support-limitations"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Enabling Queryable Encryption on a collection redacts fields from some diagnostic commands and omits some operations from the query log. This limits the data available to MongoDB support engineers, especially when analyzing query performance. To measure the impact of operations against encrypted collections, use a third party application performance monitoring tool to collect metrics. </p> <p class="leafygreen-ui-1kp3ins"> For details, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-qe-redaction" target="_self"> <span> Redaction </span> </a> section of this page. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Supported Operations <a class="headerlink leafygreen-ui-1kepx47" href="#supported-operations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="supported-operations"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption supports a subset of commands, query operators, update operators, aggregation stages, and aggregation expressions. For the list of supported operations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/supported-operations/#std-label-qe-reference-automatic-encryption-supported-operations"> Supported Operations for Queryable Encryption <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Manual Metadata Collection Compaction <a class="headerlink leafygreen-ui-1kepx47" href="#manual-metadata-collection-compaction" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="manual-metadata-collection-compaction"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Manually run <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/manage-collections/#std-label-qe-metadata-compaction"> metadata collection compaction </a> when your metadata collections exceed 1 GB. Compaction decreases the size of the metadata collections associated with encrypted fields, and improves performance. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Modifying the <code class="leafygreen-ui-1l06pbn"> encryptedFieldsMap </code> <a class="headerlink leafygreen-ui-1kepx47" href="#modifying-the-encryptedfieldsmap" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="modifying-the-encryptedfieldsmap"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Do not modify the <code class="leafygreen-ui-1l06pbn"> encryptedFieldsMap </code> passed to your <code class="leafygreen-ui-1l06pbn"> MongoClient </code> . Doing so can result in unexpected and incorrect behavior when querying. </p> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption encrypts the set of fields in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/encrypt-and-query/#std-label-qe-fundamentals-encrypt-query"> encryptedFieldsMap </a> configuration that you pass to your <code class="leafygreen-ui-1l06pbn"> MongoClient </code> constructor. If you specify a formerly plaintext field in your <code class="leafygreen-ui-1l06pbn"> encryptedFieldsMap </code> configuration that exists in the collection documents, you can only query on that field for documents inserted after you updated your <code class="leafygreen-ui-1l06pbn"> encryptedFieldsMap </code> configuration. </p> <p class="leafygreen-ui-1kp3ins"> For example, consider a database in which you have inserted documents with a plaintext <code class="leafygreen-ui-1l06pbn"> streetAddress </code> field. Adding this field to <code class="leafygreen-ui-1l06pbn"> encryptedFieldsMap </code> and performing subsequent inserts will insert the encrypted value of <code class="leafygreen-ui-1l06pbn"> streetAddress </code> into the database. The driver will send future queries for a specific <code class="leafygreen-ui-1l06pbn"> streetAddress </code> as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json-v1/#mongodb-bsontype-data_binary"> <code class="leafygreen-ui-1l06pbn"> BinData </code> </a> . As a result, the plaintext values in the original documents will never match future queries. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> The _id Field <a class="headerlink leafygreen-ui-1kepx47" href="#the-_id-field" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="the-_id-field"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You cannot configure Queryable Encryption to encrypt the <code class="leafygreen-ui-1l06pbn"> _id </code> field because it relies on the value auto-generated by MongoDB. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Encrypted Field Names <a class="headerlink leafygreen-ui-1kepx47" href="#encrypted-field-names" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="encrypted-field-names"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can't rename an encrypted field. For example, if you specify <code class="leafygreen-ui-1l06pbn"> ssn </code> as a field to encrypt, you can't <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/rename/#mongodb-update-up.-rename"> <code class="leafygreen-ui-1l06pbn"> $rename </code> </a> the field name to <code class="leafygreen-ui-1l06pbn"> taxPayerID </code> . </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Modifying Queryable Fields <a class="headerlink leafygreen-ui-1kepx47" href="#modifying-queryable-fields" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="modifying-queryable-fields"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The query type you specify for a field when creating the collection in <code class="leafygreen-ui-1l06pbn"> encryptedFieldsMap </code> is immutable. You cannot enable new query types to an existing field, and you cannot change the existing query type. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-qe-redaction"> </span> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Redaction <a class="headerlink leafygreen-ui-1kepx47" href="#redaction" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="redaction"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To improve security, Queryable Encryption redacts fields from some diagnostic commands on encrypted collections, and omits certain operations from the query log. An encrypted collection is any collection with the <code class="leafygreen-ui-1l06pbn"> encryptedFields </code> option. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Query Log and Database Profiler Redaction <a class="headerlink leafygreen-ui-1kepx47" href="#query-log-and-database-profiler-redaction" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="query-log-and-database-profiler-redaction"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The CRUD operations below are omitted from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-message-slow-ops"> slow operations </a> query log and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/database-profiler/#std-label-profiler"> Database Profiler </a> <code class="leafygreen-ui-1l06pbn"> system.profile </code> collection when you run them on an encrypted collection. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/aggregate/#mongodb-dbcommand-dbcmd.aggregate"> <code class="leafygreen-ui-1l06pbn"> aggregate </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/count/#mongodb-dbcommand-dbcmd.count"> <code class="leafygreen-ui-1l06pbn"> count </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/delete/#mongodb-dbcommand-dbcmd.delete"> <code class="leafygreen-ui-1l06pbn"> delete </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/find/#mongodb-dbcommand-dbcmd.find"> <code class="leafygreen-ui-1l06pbn"> find </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/findAndModify/#mongodb-dbcommand-dbcmd.findAndModify"> <code class="leafygreen-ui-1l06pbn"> findAndModify </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/insert/#mongodb-dbcommand-dbcmd.insert"> <code class="leafygreen-ui-1l06pbn"> insert </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/update/#mongodb-dbcommand-dbcmd.update"> <code class="leafygreen-ui-1l06pbn"> update </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.bulkWrite/#mongodb-method-db.collection.bulkWrite"> <code class="leafygreen-ui-1l06pbn"> db.collection.bulkWrite() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> compactStructuredEncryptionData </code> command </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> cleanupStructuredEncryptionData </code> command </p> </li> </ul> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Command and Aggregation Stage Output Redaction <a class="headerlink leafygreen-ui-1kepx47" href="#command-and-aggregation-stage-output-redaction" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="command-and-aggregation-stage-output-redaction"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collStats/#mongodb-dbcommand-dbcmd.collStats"> <code class="leafygreen-ui-1l06pbn"> collStats </code> </a> command and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/collStats/#mongodb-pipeline-pipe.-collStats"> <code class="leafygreen-ui-1l06pbn"> $collStats </code> </a> aggregation stage: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Omit <code class="leafygreen-ui-1l06pbn"> "queryExecStats" </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Omit <code class="leafygreen-ui-1l06pbn"> "latencyStats" </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Redact <code class="leafygreen-ui-1l06pbn"> "WiredTiger" </code> , if present, to include only the <code class="leafygreen-ui-1l06pbn"> url </code> field. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-dbcommand-dbcmd.currentOp"> <code class="leafygreen-ui-1l06pbn"> currentOp </code> </a> command and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/currentOp/#mongodb-pipeline-pipe.-currentOp"> <code class="leafygreen-ui-1l06pbn"> $currentOp </code> </a> aggregation stage: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Omit all fields after <code class="leafygreen-ui-1l06pbn"> "command" </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Redact <code class="leafygreen-ui-1l06pbn"> "command" </code> to include only the first element, <code class="leafygreen-ui-1l06pbn"> $comment </code> , and <code class="leafygreen-ui-1l06pbn"> $db </code> . </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/top/#mongodb-dbcommand-dbcmd.top"> <code class="leafygreen-ui-1l06pbn"> top </code> </a> command only returns the collection name of encrypted collections. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/planCacheStats/#mongodb-pipeline-pipe.-planCacheStats"> <code class="leafygreen-ui-1l06pbn"> $planCacheStats </code> </a> aggregation stage omits operations against encrypted collections, even though the operations are cached as normal. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Topology Support <a class="headerlink leafygreen-ui-1kepx47" href="#topology-support" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="topology-support"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Replica sets and sharded clusters are supported </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Standalone deployments are not supported </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Secondary reads are not supported </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Sharding <a class="headerlink leafygreen-ui-1kepx47" href="#sharding" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sharding"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Metadata collections must not be sharded </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Shard keys must not be encrypted fields </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Collections <a class="headerlink leafygreen-ui-1kepx47" href="#collections" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="collections"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot use Client-Side Field Level Encryption with Queryable Encryption on the same collection. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption does not support migration from collections encrypted with Client-Side Field Level Encryption. You must decrypt your documents and insert them one-by-one. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption does not support automatic migration from an unencrypted collection. You must insert the documents one-by-one. </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption supports new collections only. You cannot add or remove Queryable Encryption to existing collections. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot rename a collection with encrypted fields. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot specify <code class="leafygreen-ui-1l06pbn"> jsonSchema </code> to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createCollection/#mongodb-method-db.createCollection"> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </a> when creating a Queryable Encryption collection if the <code class="leafygreen-ui-1l06pbn"> jsonSchema </code> contains the <code class="leafygreen-ui-1l06pbn"> encrypt </code> keyword. </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You can specify both <code class="leafygreen-ui-1l06pbn"> encryptedFields </code> and <code class="leafygreen-ui-1l06pbn"> jsonSchema </code> to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createCollection/#mongodb-method-db.createCollection"> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </a> as long as your <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/schema-validation/#std-label-schema-validation-overview"> jsonSchema </a> does not contain validation for encrypted fields. </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption does not support <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/#std-label-views-landing-page"> Views </a> , <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries-collections/#std-label-manual-timeseries-collection"> Time Series Collections </a> , or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/capped-collections/#std-label-manual-capped-collection"> capped collection <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption does not support <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-ttl/#std-label-index-feature-ttl"> TTL Indexes </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-unique/#std-label-index-type-unique"> Unique Indexes <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot disable <code class="leafygreen-ui-1l06pbn"> jsonSchema </code> validation. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When a collection uses the <code class="leafygreen-ui-1l06pbn"> encryptedFields </code> option: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot set <code class="leafygreen-ui-1l06pbn"> validationLevel </code> to <code class="leafygreen-ui-1l06pbn"> none </code> . </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot set <code class="leafygreen-ui-1l06pbn"> validationAction </code> to <code class="leafygreen-ui-1l06pbn"> warn </code> . </p> </li> </ul> </li> </ul> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Drop Collection <a class="headerlink leafygreen-ui-1kepx47" href="#drop-collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="drop-collection"> </div> </a> </h3> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Dropping collections from a <code class="leafygreen-ui-1l06pbn"> MongoClient </code> that is not configured for Queryable Encryption doesn't drop the associated metadata collections. <code class="leafygreen-ui-1l06pbn"> mongod </code> logs a warning if you drop a collection with encrypted fields before dropping the metadata collections. </p> </li> </ul> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> When dropping a collection with a <code class="leafygreen-ui-1l06pbn"> MongoClient </code> configured for Queryable Encryption, compatible drivers drop the associated metadata collections as well. </p> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create Collection <a class="headerlink leafygreen-ui-1kepx47" href="#create-collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-collection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Always explicitly create any collections that use Queryable Encryption. Implicit collection creation doesn't create the necessary indexes and metadata collections, resulting in poor query performance. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Arrays <a class="headerlink leafygreen-ui-1kepx47" href="#arrays" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="arrays"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption does not support automatic encryption on fields within an array of documents. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Views <a class="headerlink leafygreen-ui-1kepx47" href="#views" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="views"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Applications cannot rely on the automatic encryption validation to prevent unsupported queries against views on collections with encrypted fields. </p> <p class="leafygreen-ui-1kp3ins"> Queries against <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/#std-label-views-landing-page"> views </a> on collections containing values encrypted with Queryable Encryption may return unexpected or incorrect results if either the underlying view aggregation pipeline <em> or </em> the query references encrypted fields. If creating a view on a collection containing values encrypted with Queryable Encryption, avoid operating on encrypted fields to mitigate the risk of unexpected or incorrect results. </p> <p class="leafygreen-ui-1kp3ins"> For more information on views, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/views/#std-label-views-landing-page"> Views <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Collation <a class="headerlink leafygreen-ui-1kepx47" href="#collation" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="collation"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption ignores user-specified collations or collection default collations. Encryption obscures the field value and prevents normal collation behavior. Collation-sensitive queries against encrypted fields may return unexpected or incorrect results. </p> <p class="leafygreen-ui-1kp3ins"> For more information on collations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation-document-fields"> Collation Document <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption-compatible drivers have a list of <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/supported-operations/#std-label-qe-reference-automatic-encryption-supported-operations"> supported operations for automatic encryption </a> . For unsupported read and write operations, the underlying support library cannot introspect the collection catalog to identify the default collation. Applications therefore cannot rely on the Queryable Encryption validation to prevent querying on encrypted fields with collation defaults. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Unique Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#unique-indexes" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="unique-indexes"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-unique/#std-label-index-type-unique"> Unique indexes </a> can't guarantee uniqueness if the index key specifies any encrypted fields. </p> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption always outputs a different encrypted value, even for the same input. The server considers each encrypted value unique, even though the decrypted value may not be. This means that even if a collection uses an index-enforced unique constraint on fields, the collection can still contain multiple documents with duplicate plaintext values for that field. </p> <p class="leafygreen-ui-1kp3ins"> Queryable Encryption compatible drivers configured for automatic encryption <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/supported-operations/#std-label-qe-reference-automatic-encryption-supported-operations"> support some operations for automatic encryption </a> . For unsupported read and write operations, the underlying library can't introspect the index catalog to identify a given field as unique. Applications can't rely on automatic encryption validation to prevent unique constraint violations on randomly-encrypted fields. </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/js-database/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Database Methods <a class="headerlink leafygreen-ui-1kepx47" href="#database-methods" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="database-methods"> </div> </a> </h1> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For details on a specific method, including syntax and examples, click on the link to the method's reference page. </p> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.adminCommand/#mongodb-method-db.adminCommand"> <code class="leafygreen-ui-1l06pbn"> db.adminCommand() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Runs a command against the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.aggregate/#mongodb-method-db.aggregate"> <code class="leafygreen-ui-1l06pbn"> db.aggregate() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Runs admin/diagnostic pipeline which does not require an underlying collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.commandHelp/#mongodb-method-db.commandHelp"> <code class="leafygreen-ui-1l06pbn"> db.commandHelp() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns help information for a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-database-command"> database command <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createCollection/#mongodb-method-db.createCollection"> <code class="leafygreen-ui-1l06pbn"> db.createCollection() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a new collection or a view. Commonly used to create a capped collection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createView/#mongodb-method-db.createView"> <code class="leafygreen-ui-1l06pbn"> db.createView() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a view. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.currentOp/#mongodb-method-db.currentOp"> <code class="leafygreen-ui-1l06pbn"> db.currentOp() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Reports the current in-progress operations. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.dropDatabase/#mongodb-method-db.dropDatabase"> <code class="leafygreen-ui-1l06pbn"> db.dropDatabase() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes the current database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.fsyncLock/#mongodb-method-db.fsyncLock"> <code class="leafygreen-ui-1l06pbn"> db.fsyncLock() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Flushes writes to disk and locks the database to prevent write operations and assist backup operations. Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/fsync/#mongodb-dbcommand-dbcmd.fsync"> <code class="leafygreen-ui-1l06pbn"> fsync </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.fsyncUnlock/#mongodb-method-db.fsyncUnlock"> <code class="leafygreen-ui-1l06pbn"> db.fsyncUnlock() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Allows writes to continue on a database locked with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.fsyncLock/#mongodb-method-db.fsyncLock"> <code class="leafygreen-ui-1l06pbn"> db.fsyncLock() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getCollection/#mongodb-method-db.getCollection"> <code class="leafygreen-ui-1l06pbn"> db.getCollection() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a collection or view object. Used to access collections with names that are not valid in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> . </span> </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getCollectionInfos/#mongodb-method-db.getCollectionInfos"> <code class="leafygreen-ui-1l06pbn"> db.getCollectionInfos() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns collection information for all collections and views in the current database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getCollectionNames/#mongodb-method-db.getCollectionNames"> <code class="leafygreen-ui-1l06pbn"> db.getCollectionNames() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Lists all collections and views in the current database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getLogComponents/#mongodb-method-db.getLogComponents"> <code class="leafygreen-ui-1l06pbn"> db.getLogComponents() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the log message verbosity levels. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getMongo/#mongodb-method-db.getMongo"> <code class="leafygreen-ui-1l06pbn"> db.getMongo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> connection object for the current connection. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getName/#mongodb-method-db.getName"> <code class="leafygreen-ui-1l06pbn"> db.getName() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the name of the current database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getProfilingStatus/#mongodb-method-db.getProfilingStatus"> <code class="leafygreen-ui-1l06pbn"> db.getProfilingStatus() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document that reflects the current profiling level and the profiling threshold. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getReplicationInfo/#mongodb-method-db.getReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> db.getReplicationInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document with replication statistics. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getSiblingDB/#mongodb-method-db.getSiblingDB"> <code class="leafygreen-ui-1l06pbn"> db.getSiblingDB() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Provides access to the specified database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.hello/#mongodb-method-db.hello"> <code class="leafygreen-ui-1l06pbn"> db.hello() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document that reports the state of the replica set. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.help/#mongodb-method-db.help"> <code class="leafygreen-ui-1l06pbn"> db.help() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Displays descriptions of common <code class="leafygreen-ui-1l06pbn"> db </code> object methods. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.hostInfo/#mongodb-method-db.hostInfo"> <code class="leafygreen-ui-1l06pbn"> db.hostInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document with information about the system MongoDB runs on. Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/hostInfo/#mongodb-dbcommand-dbcmd.hostInfo"> <code class="leafygreen-ui-1l06pbn"> hostInfo </code> </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.killOp/#mongodb-method-db.killOp"> <code class="leafygreen-ui-1l06pbn"> db.killOp() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Terminates a specified operation. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.listCommands/#mongodb-method-db.listCommands"> <code class="leafygreen-ui-1l06pbn"> db.listCommands() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Displays a list of common database commands. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.logout/#mongodb-method-db.logout"> <code class="leafygreen-ui-1l06pbn"> db.logout() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <em> Deprecated </em> . Ends an authenticated session. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.printCollectionStats/#mongodb-method-db.printCollectionStats"> <code class="leafygreen-ui-1l06pbn"> db.printCollectionStats() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prints statistics from every collection. Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.stats/#mongodb-method-db.collection.stats"> <code class="leafygreen-ui-1l06pbn"> db.collection.stats() </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.printReplicationInfo/#mongodb-method-db.printReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> db.printReplicationInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prints a formatted report of the replica set status from the perspective of the primary. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.printSecondaryReplicationInfo/#mongodb-method-db.printSecondaryReplicationInfo"> <code class="leafygreen-ui-1l06pbn"> db.printSecondaryReplicationInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prints a formatted report of the replica set status from the perspective of the secondaries. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.printShardingStatus/#mongodb-method-db.printShardingStatus"> <code class="leafygreen-ui-1l06pbn"> db.printShardingStatus() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Prints a report of the sharding configuration and the chunk ranges. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.resetError/#mongodb-method-db.resetError"> <code class="leafygreen-ui-1l06pbn"> db.resetError() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <em> Removed in MongoDB 5.0. </em> Resets the last error status. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.rotateCertificates/#mongodb-method-db.rotateCertificates"> <code class="leafygreen-ui-1l06pbn"> db.rotateCertificates() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Performs online TLS certificate rotation. Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/rotateCertificates/#mongodb-dbcommand-dbcmd.rotateCertificates"> <code class="leafygreen-ui-1l06pbn"> rotateCertificates </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.runCommand/#mongodb-method-db.runCommand"> <code class="leafygreen-ui-1l06pbn"> db.runCommand() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Runs a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/#std-label-database-commands"> database command <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.serverBuildInfo/#mongodb-method-db.serverBuildInfo"> <code class="leafygreen-ui-1l06pbn"> db.serverBuildInfo() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document that displays the compilation parameters for the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance. Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/buildInfo/#mongodb-dbcommand-dbcmd.buildInfo"> <code class="leafygreen-ui-1l06pbn"> buildInfo </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.serverCmdLineOpts/#mongodb-method-db.serverCmdLineOpts"> <code class="leafygreen-ui-1l06pbn"> db.serverCmdLineOpts() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document with information about the runtime used to start the MongoDB instance. Wraps <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/getCmdLineOpts/#mongodb-dbcommand-dbcmd.getCmdLineOpts"> <code class="leafygreen-ui-1l06pbn"> getCmdLineOpts </code> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.serverStatus/#mongodb-method-db.serverStatus"> <code class="leafygreen-ui-1l06pbn"> db.serverStatus() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document that provides an overview of the state of the database process. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.setLogLevel/#mongodb-method-db.setLogLevel"> <code class="leafygreen-ui-1l06pbn"> db.setLogLevel() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Sets a single log message verbosity level. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.setProfilingLevel/#mongodb-method-db.setProfilingLevel"> <code class="leafygreen-ui-1l06pbn"> db.setProfilingLevel() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Modifies the current level of database profiling. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.shutdownServer/#mongodb-method-db.shutdownServer"> <code class="leafygreen-ui-1l06pbn"> db.shutdownServer() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Shuts down the current <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> process cleanly and safely. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.stats/#mongodb-method-db.stats"> <code class="leafygreen-ui-1l06pbn"> db.stats() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns a document that reports on the state of the current database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.version/#mongodb-method-db.version"> <code class="leafygreen-ui-1l06pbn"> db.version() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns the version of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.watch/#mongodb-method-db.watch"> <code class="leafygreen-ui-1l06pbn"> db.watch() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Opens a <a class="leafygreen-ui-tqgtui" href="/docs/manual/changeStreams/#std-label-changeStreams"> change stream cursor </a> for a database to report on all its non- <code class="leafygreen-ui-1l06pbn"> system </code> collections. Cannot be opened on the <code class="leafygreen-ui-1l06pbn"> admin </code> , <code class="leafygreen-ui-1l06pbn"> local </code> or <code class="leafygreen-ui-1l06pbn"> config </code> databases. </div> </div> </td> </tr> </tbody> </table> </div> </section>
https://www.mongodb.com/docs/manual/reference/command/nav-geospatial/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Geospatial Commands <a class="headerlink leafygreen-ui-1kepx47" href="#geospatial-commands" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="geospatial-commands"> </div> </a> </h1> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For details on a specific command, including syntax and examples, click on the link to the command's reference page. </p> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/geoSearch/#mongodb-dbcommand-dbcmd.geoSearch"> <code class="leafygreen-ui-1l06pbn"> geoSearch </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <em> Removed in MongoDB 5.0. </em> Performs a geospatial query that uses MongoDB's haystack index functionality. </div> </div> </td> </tr> </tbody> </table> </div> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/ifNull/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $ifNull (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-ifnull--aggregation-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-ifnull--aggregation-"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $ifNull </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-ifNull" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-expression-exp.-ifNull"> </div> </a> </dt> <dd> </dd> </dl> <div> <p> <em> Changed <!-- --> in version <!-- --> 5.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-ifNull" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $ifNull </code> </span> </a> expression evaluates input expressions for null values and returns: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The first non-null input <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> value found. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A replacement <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> value if all input expressions evaluate to null. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-ifNull" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $ifNull </code> </span> </a> treats undefined values and missing fields as null. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can use <code class="leafygreen-ui-1l06pbn"> $ifNull </code> for deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n $ifNull: [\n &lt;input-expression-1&gt;,\n ...\n &lt;input-expression-n&gt;,\n &lt;replacement-expression-if-null&gt;\n ]\n}"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> $ifNull: [</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;input-expression-1&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ...</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;input-expression-n&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;replacement-expression-if-null&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This <code class="leafygreen-ui-1l06pbn"> inventory </code> collection is used in the examples: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.insertMany( [\n { \"_id\" : 1, \"item\" : \"buggy\", description: \"toy car\", \"quantity\" : 300 },\n { \"_id\" : 2, \"item\" : \"bicycle\", description: null, \"quantity\" : 200 },\n { \"_id\" : 3, \"item\" : \"flag\" }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"buggy"</span>, <span class="lg-highlight-attr">description</span>: <span class="lg-highlight-string">"toy car"</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">300</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"bicycle"</span>, <span class="lg-highlight-attr">description</span>: <span class="lg-highlight-literal">null</span>, <span class="lg-highlight-string">"quantity"</span> <!-- -->: <span class="lg-highlight-number">200</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"flag"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Single Input Expression <a class="headerlink leafygreen-ui-1kepx47" href="#single-input-expression" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="single-input-expression"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example uses <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-ifNull" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $ifNull </code> </span> </a> to return: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> description </code> if it is non-null. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "Unspecified" </code> string if <code class="leafygreen-ui-1l06pbn"> description </code> is null or missing. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.aggregate(\n [\n {\n $project: {\n item: 1,\n description: { $ifNull: [ \"$description\", \"Unspecified\" ] }\n }\n }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">description</span>: <!-- -->{ <span class="lg-highlight-attr">$ifNull</span>: <!-- -->[ <span class="lg-highlight-string">"$description"</span>, <span class="lg-highlight-string">"Unspecified"</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"item\" : \"buggy\", \"description\" : \"toy car\" }\n{ \"_id\" : 2, \"item\" : \"bicycle\", \"description\" : \"Unspecified\" }\n{ \"_id\" : 3, \"item\" : \"flag\", \"description\" : \"Unspecified\" }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1453az5" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"buggy"</span>, <span class="lg-highlight-string">"description"</span> <!-- -->: <span class="lg-highlight-string">"toy car"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"bicycle"</span>, <span class="lg-highlight-string">"description"</span> <!-- -->: <span class="lg-highlight-string">"Unspecified"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"flag"</span>, <span class="lg-highlight-string">"description"</span> <!-- -->: <span class="lg-highlight-string">"Unspecified"</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Multiple Input Expressions <a class="headerlink leafygreen-ui-1kepx47" href="#multiple-input-expressions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="multiple-input-expressions"> </div> </a> </h3> <div> <p> <em> New <!-- --> in version <!-- --> 5.0 </em> . </p> </div> <p class="leafygreen-ui-1kp3ins"> The following example uses <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-ifNull" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $ifNull </code> </span> </a> to return: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> description </code> if it is non-null. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> quantity </code> if <code class="leafygreen-ui-1l06pbn"> description </code> is null or missing and <code class="leafygreen-ui-1l06pbn"> quantity </code> is non-null. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> "Unspecified" </code> string if <code class="leafygreen-ui-1l06pbn"> description </code> and <code class="leafygreen-ui-1l06pbn"> quantity </code> are both null or missing. </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.aggregate(\n [\n {\n $project: {\n item: 1,\n value: { $ifNull: [ \"$description\", \"$quantity\", \"Unspecified\" ] }\n }\n }\n ]\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$project</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-number">1</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">value</span>: <!-- -->{ <span class="lg-highlight-attr">$ifNull</span>: <!-- -->[ <span class="lg-highlight-string">"$description"</span>, <span class="lg-highlight-string">"$quantity"</span>, <span class="lg-highlight-string">"Unspecified"</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"item\" : \"buggy\", \"value\" : \"toy car\" }\n{ \"_id\" : 2, \"item\" : \"bicycle\", \"value\" : 200 }\n{ \"_id\" : 3, \"item\" : \"flag\", \"value\" : \"Unspecified\" }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"buggy"</span>, <span class="lg-highlight-string">"value"</span> <!-- -->: <span class="lg-highlight-string">"toy car"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"bicycle"</span>, <span class="lg-highlight-string">"value"</span> <!-- -->: <span class="lg-highlight-number">200</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"item"</span> <!-- -->: <span class="lg-highlight-string">"flag"</span>, <span class="lg-highlight-string">"value"</span> <!-- -->: <span class="lg-highlight-string">"Unspecified"</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/change-sharded-cluster-wiredtiger/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Change a Self-Managed Sharded Cluster to WiredTiger <a class="headerlink leafygreen-ui-1kepx47" href="#change-a-self-managed-sharded-cluster-to-wiredtiger" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="change-a-self-managed-sharded-cluster-to-wiredtiger"> </div> </a> </h1> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You must upgrade to WiredTiger. MongoDB removed the deprecated MMAPv1 storage engine in version 4.2. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Use this tutorial to update a sharded cluster to use <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/wiredtiger/#std-label-storage-wiredtiger"> WiredTiger <!-- --> . </a> </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#considerations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="considerations"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Downtime <a class="headerlink leafygreen-ui-1kepx47" href="#downtime" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="downtime"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you change the host or port of any <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard"> shard </a> , you must update the shard configuration as well. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-sharded-cluster-mmapv1-wt-4.0-psa"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> PSA 3-member Architecture <a class="headerlink leafygreen-ui-1kepx47" href="#psa-3-member-architecture" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="psa-3-member-architecture"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> read concern, available for WiredTiger, is enabled by default. However, if you have a three-member shard replica set with a primary-secondary-arbiter (PSA) architecture, you can disable <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> read concern for that shard replica set. Disabling <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> for a three member PSA architecture avoids possible cache-pressure build up. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Disabling <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> read concern has no effect on change streams availability. </p> <p class="leafygreen-ui-1kp3ins"> Disabling <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> read concern prevents <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/collMod/#mongodb-dbcommand-dbcmd.collMod"> <code class="leafygreen-ui-1l06pbn"> collMod </code> </a> commands which modify an index from <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-rollbacks/#std-label-replica-set-rollbacks"> rolling back </a> . If such an operation needs to be rolled back, you must resync the affected nodes with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> node. </p> <p class="leafygreen-ui-1kp3ins"> Disabling <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> read concern affects support for <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions"> transactions </a> on sharded clusters. Specifically: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A transaction cannot use read concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-snapshot/#mongodb-readconcern-readconcern.-snapshot-"> <code class="leafygreen-ui-1l06pbn"> "snapshot" </code> </a> if the transaction involves a shard that has <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#std-label-disable-read-concern-majority"> disabled read concern "majority" <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A transaction that writes to multiple shards errors if any of the transaction's read or write operations involves a shard that has disabled read concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> . </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> However, it does not affect <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions"> transactions </a> on replica sets. For transactions on replica sets, you can specify read concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> (or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-snapshot/#mongodb-readconcern-readconcern.-snapshot-"> <code class="leafygreen-ui-1l06pbn"> "snapshot" </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-local/#mongodb-readconcern-readconcern.-local-"> <code class="leafygreen-ui-1l06pbn"> "local" </code> </a> ) for distributed transactions even if read concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> is disabled. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on PSA architecture and read concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#mongodb-readconcern-readconcern.-majority-"> <code class="leafygreen-ui-1l06pbn"> "majority" </code> </a> , see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-majority/#std-label-disable-read-concern-majority"> Primary-Secondary-Arbiter Replica Sets <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Default Bind to Localhost <a class="headerlink leafygreen-ui-1kepx47" href="#default-bind-to-localhost" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="default-bind-to-localhost"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB binaries, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , bind to <code class="leafygreen-ui-1l06pbn"> localhost </code> by default. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Config Servers <a class="headerlink leafygreen-ui-1kepx47" href="#config-servers" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="config-servers"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Config servers must be deployed as replica sets (CSRS). As such, config servers already use the WiredTiger storage engine. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> XFS and WiredTiger <a class="headerlink leafygreen-ui-1kepx47" href="#xfs-and-wiredtiger" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="xfs-and-wiredtiger"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> With the WiredTiger storage engine, using XFS for data bearing nodes is recommended on Linux. For more information, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/production-notes/#std-label-prod-notes-linux-file-system"> Kernel and File Systems <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> MMAPv1 Only Restrictions <a class="headerlink leafygreen-ui-1kepx47" href="#mmapv1-only-restrictions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mmapv1-only-restrictions"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Once upgraded to WiredTiger, your WiredTiger deployment is <strong> not </strong> subject to the following MMAPv1-only restrictions: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> MMAPv1 Restrictions </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Short Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Number of Namespaces </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> For MMAPv1, the number of namespaces is limited to the size of the namespace file divided by 628. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Size of Namespace File </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> For MMAPv1, namespace files can be no larger than 2047 megabytes. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Database Size </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The MMAPv1 storage engine limits each database to no more than 16000 data files. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Data Size </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> For MMAPv1, a single <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance cannot manage a data set that exceeds maximum virtual memory address space provided by the underlying operating system. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Number of Collections in a Database </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> For the MMAPv1 storage engine, the maximum number of collections in a database is a function of the size of the namespace file and the number of indexes of collections in the database. </div> </div> </td> </tr> </tbody> </table> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Before You Begin <a class="headerlink leafygreen-ui-1kepx47" href="#before-you-begin" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="before-you-begin"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-directShardOperations"> <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> </a> role to perform maintenance operations that require you to execute commands directly against a shard. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Running commands using the <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> role can cause your cluster to stop working correctly and may cause data corruption. Only use the <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> role for maintenance purposes or under the guidance of MongoDB support. Once you are done performing maintenance operations, stop using the <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> role. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#procedure" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="procedure"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> For each replica set <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard"> shard </a> , to change the storage engine to WiredTiger: </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> A. Update the secondary members to WiredTiger. <a class="headerlink leafygreen-ui-1kepx47" href="#a.-update-the-secondary-members-to-wiredtiger." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="a.-update-the-secondary-members-to-wiredtiger."> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Update the secondary members one at a time: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Shut down the secondary member.In mongosh, shut down the secondary."},{"@type":"HowToStep","text":"Prepare a data directory for the new mongod running with WiredTiger.Prepare a data directory for the new mongod instance that\nwill run with the WiredTiger storage engine. mongod must have read\nand write permissions for this directory. You can either delete the\ncontents of the stopped secondary member's current data directory or\ncreate a new directory entirely.mongod with WiredTiger will not start with data files created with\na different storage engine."},{"@type":"HowToStep","text":"Update configuration for WiredTiger.Remove any MMAPv1 configuration options from the mongod\ninstance configuration."},{"@type":"HowToStep","text":"Start mongod with WiredTiger.Start mongod, specifying wiredTiger as the\n--storageEngine and the prepared data directory for\nWiredTiger as the --dbpath.Specify additional options as appropriate, such as\n--bind_ip.Before you bind your instance to a publicly-accessible IP address,\nyou must secure your cluster from unauthorized access. For a complete\nlist of security recommendations, see\nSecurity Checklist for Self-Managed Deployments. At minimum, consider\nenabling authentication and hardening\nnetwork infrastructure.If you are running a three-member PSA architecture, include\n--enableMajorityReadConcern false\nto disable read concern majority. See PSA 3-member Architecture.Since no data exists in the --dbpath, the mongod will perform an\ninitial sync. The length of the\ninitial sync process depends on the size of the database and network\nconnection between members of the replica set.You can also specify the options in a configuration file. To specify the storage engine, use\nthe storage.engine setting."}],"name":"A. Update the secondary members to WiredTiger.","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Shut down the secondary member. <a class="headerlink leafygreen-ui-1kepx47" href="#shut-down-the-secondary-member" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="shut-down-the-secondary-member"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> In <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , shut down the secondary. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use admin\ndb.shutdownServer()\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use admin</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.shutdownServer()</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Prepare a data directory for the new <code class="leafygreen-ui-1l06pbn"> mongod </code> running with WiredTiger. <a class="headerlink leafygreen-ui-1kepx47" href="#prepare-a-data-directory-for-the-new-mongod-running-with-wiredtiger" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="prepare-a-data-directory-for-the-new-mongod-running-with-wiredtiger"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Prepare a data directory for the new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance that will run with the WiredTiger storage engine. <code class="leafygreen-ui-1l06pbn"> mongod </code> must have read and write permissions for this directory. You can either delete the contents of the stopped secondary member's current data directory or create a new directory entirely. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> mongod </code> with WiredTiger will not start with data files created with a different storage engine. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Update configuration for WiredTiger. <a class="headerlink leafygreen-ui-1kepx47" href="#update-configuration-for-wiredtiger" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="update-configuration-for-wiredtiger"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Remove any MMAPv1 configuration options from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance configuration. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Start <code class="leafygreen-ui-1l06pbn"> mongod </code> with WiredTiger. <a class="headerlink leafygreen-ui-1kepx47" href="#start-mongod-with-wiredtiger" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="start-mongod-with-wiredtiger"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Start <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> , specifying <code class="leafygreen-ui-1l06pbn"> wiredTiger </code> as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--storageEngine"> <code class="leafygreen-ui-1l06pbn"> --storageEngine </code> </a> and the prepared data directory for WiredTiger as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--dbpath"> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Specify additional options as appropriate, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--bind_ip"> <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> . </a> </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Before you bind your instance to a publicly-accessible IP address, you must secure your cluster from unauthorized access. For a complete list of security recommendations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-security-checklist"> Security Checklist for Self-Managed Deployments </a> . At minimum, consider <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-checklist-auth"> enabling authentication </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-hardening/#std-label-network-config-hardening"> hardening network infrastructure <!-- --> . </a> </p> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-18"> <div aria-label="Tabs to describe usage of general/psa36" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_m7fbnfabv" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_lzw9wapjw" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> General Use (For Most Architectures) </div> </button> <button aria-controls="_sqn8c26y1" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_q2tusqeoc" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PSA Architecture </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_lan6kvkbf" class="" id="_iuqm9d02t" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --storageEngine wiredTiger --dbpath &lt;newwiredtigerdbpath&gt; --replSet &lt;replsetname&gt; --bind_ip localhost,&lt;hostname(s)|ip&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --storageEngine wiredTiger --dbpath &lt;newWiredTigerDBPath&gt; --replSet &lt;replSetName&gt; --bind_ip localhost,&lt;hostname(s)|ip address(es)&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_ifr51u1bs" class="leafygreen-ui-38lglc" id="_w298efw7j" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If you are running a three-member PSA architecture, include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--enableMajorityReadConcern"> <code class="leafygreen-ui-1l06pbn"> --enableMajorityReadConcern false </code> </a> to disable read concern <code class="leafygreen-ui-1l06pbn"> majority </code> . <!-- --> See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-sharded-cluster-mmapv1-wt-4.0-psa" target="_self"> <span> PSA 3-member Architecture </span> </a> . </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --storageEngine wiredTiger --dbpath &lt;newwiredtigerdbpath&gt; --replSet &lt;replsetname&gt; --bind_ip localhost,&lt;hostname(s)|ip&gt; --enableMajorityReadConcern false","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --storageEngine wiredTiger --dbpath &lt;newWiredTigerDBPath&gt; --replSet &lt;replSetName&gt; --bind_ip localhost,&lt;hostname(s)|ip address(es)&gt; --enableMajorityReadConcern <span class="lg-highlight-literal">false</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Since no data exists in the <code class="leafygreen-ui-1l06pbn"> --dbpath </code> , the <code class="leafygreen-ui-1l06pbn"> mongod </code> will perform an <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/resync-replica-set-member/#std-label-resync-replica-member"> initial sync </a> . The length of the initial sync process depends on the size of the database and network connection between members of the replica set. </p> <p class="leafygreen-ui-1kp3ins"> You can also specify the options in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/"> configuration file </a> . To specify the storage engine, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.engine"> <code class="leafygreen-ui-1l06pbn"> storage.engine </code> </a> setting. </p> </section> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Repeat the steps for the remaining secondary members, updating them one at a time. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> B. Step down the primary. <a class="headerlink leafygreen-ui-1kepx47" href="#b.-step-down-the-primary." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="b.-step-down-the-primary."> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Once all the secondary members have been upgraded to WiredTiger, connect <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to the primary and use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.stepDown/#mongodb-method-rs.stepDown"> <code class="leafygreen-ui-1l06pbn"> rs.stepDown() </code> </a> to step down the primary and force an election of a new primary. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"rs.stepDown()","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">stepDown</span>(<!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> C. Update the old primary. <a class="headerlink leafygreen-ui-1kepx47" href="#c.-update-the-old-primary." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="c.-update-the-old-primary."> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> When the primary has stepped down and become a secondary, update the secondary to use WiredTiger as before: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Shut down the secondary member.In mongosh, shut down the secondary."},{"@type":"HowToStep","text":"Prepare a data directory for the new mongod running with WiredTiger.Prepare a data directory for the new mongod instance that\nwill run with the WiredTiger storage engine. mongod must have read\nand write permissions for this directory. You can either delete the\ncontents of the stopped secondary member's current data directory or\ncreate a new directory entirely.mongod with WiredTiger will not start with data files created with\na different storage engine."},{"@type":"HowToStep","text":"Update configuration for WiredTiger.Remove any MMAPv1 configuration options from the mongod\ninstance configuration."},{"@type":"HowToStep","text":"Start mongod with WiredTiger.Start mongod, specifying wiredTiger as the\n--storageEngine and the prepared data directory for\nWiredTiger as the --dbpath.Specify additional options as appropriate, such as\n--bind_ip.Before you bind your instance to a publicly-accessible IP address,\nyou must secure your cluster from unauthorized access. For a complete\nlist of security recommendations, see\nSecurity Checklist for Self-Managed Deployments. At minimum, consider\nenabling authentication and hardening\nnetwork infrastructure.If you are running a three-member PSA architecture, include\n--enableMajorityReadConcern false\nto disable read concern majority. See PSA 3-member Architecture.Since no data exists in the --dbpath, the mongod will perform an\ninitial sync. The length of the\ninitial sync process depends on the size of the database and network\nconnection between members of the replica set.You can also specify the options in a configuration file. To specify the storage engine, use\nthe storage.engine setting."}],"name":"C. Update the old primary.","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Shut down the secondary member. <a class="headerlink leafygreen-ui-1kepx47" href="#shut-down-the-secondary-member-1" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="shut-down-the-secondary-member-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> In <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , shut down the secondary. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use admin\ndb.shutdownServer()\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use admin</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.shutdownServer()</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Prepare a data directory for the new <code class="leafygreen-ui-1l06pbn"> mongod </code> running with WiredTiger. <a class="headerlink leafygreen-ui-1kepx47" href="#prepare-a-data-directory-for-the-new-mongod-running-with-wiredtiger-1" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="prepare-a-data-directory-for-the-new-mongod-running-with-wiredtiger-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Prepare a data directory for the new <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance that will run with the WiredTiger storage engine. <code class="leafygreen-ui-1l06pbn"> mongod </code> must have read and write permissions for this directory. You can either delete the contents of the stopped secondary member's current data directory or create a new directory entirely. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> mongod </code> with WiredTiger will not start with data files created with a different storage engine. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Update configuration for WiredTiger. <a class="headerlink leafygreen-ui-1kepx47" href="#update-configuration-for-wiredtiger-1" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="update-configuration-for-wiredtiger-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Remove any MMAPv1 configuration options from the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance configuration. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Start <code class="leafygreen-ui-1l06pbn"> mongod </code> with WiredTiger. <a class="headerlink leafygreen-ui-1kepx47" href="#start-mongod-with-wiredtiger-1" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="start-mongod-with-wiredtiger-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Start <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> , specifying <code class="leafygreen-ui-1l06pbn"> wiredTiger </code> as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--storageEngine"> <code class="leafygreen-ui-1l06pbn"> --storageEngine </code> </a> and the prepared data directory for WiredTiger as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--dbpath"> <code class="leafygreen-ui-1l06pbn"> --dbpath </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Specify additional options as appropriate, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--bind_ip"> <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> . </a> </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Before you bind your instance to a publicly-accessible IP address, you must secure your cluster from unauthorized access. For a complete list of security recommendations, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-security-checklist"> Security Checklist for Self-Managed Deployments </a> . At minimum, consider <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-checklist-auth"> enabling authentication </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-hardening/#std-label-network-config-hardening"> hardening network infrastructure <!-- --> . </a> </p> </div> </div> <div aria-hidden="true"> </div> <div class="leafygreen-ui-1b75luy" data-lgid="lg-tabs"> <div class="leafygreen-ui-jp7pox" id="tabs-25"> <div aria-label="Tabs to describe usage of general/psa36" aria-orientation="horizontal" class="leafygreen-ui-m8p1vb lg-ui-tab-list-0000" data-lgid="lg-tabs-tab_list" role="tablist"> <button aria-controls="_0lj777qb0" aria-selected="true" class="leafygreen-ui-1l773z1" data-text="" id="_8lv82tnnm" name="" role="tab" tabindex="0"> <div class="leafygreen-ui-1nxuzmg"> General Use (For Most Architectures) </div> </button> <button aria-controls="_sjoz8gg05" aria-selected="false" class="leafygreen-ui-1ogxb8f" data-text="" id="_1760numi2" name="" role="tab" tabindex="-1"> <div class="leafygreen-ui-1nxuzmg"> PSA Architecture </div> </button> </div> <div class="leafygreen-ui-ov1ktg"> <div class="leafygreen-ui-1sg2lsz"> </div> </div> </div> <div class="lg-ui-tab-panels-0000" data-lgid="lg-tabs-tab_panels"> <div> <div aria-labelledby="_geku3eti8" class="" id="_pihtho5uu" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --storageEngine wiredTiger --dbpath &lt;newwiredtigerdbpath&gt; --replSet &lt;replsetname&gt; --bind_ip localhost,&lt;hostname(s)|ip&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --storageEngine wiredTiger --dbpath &lt;newWiredTigerDBPath&gt; --replSet &lt;replSetName&gt; --bind_ip localhost,&lt;hostname(s)|ip address(es)&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> <div> <div aria-labelledby="_xoq1jglrm" class="leafygreen-ui-38lglc" id="_hy4om9l9r" role="tabpanel"> <div class="leafygreen-ui-1kdmo88"> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> If you are running a three-member PSA architecture, include <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#std-option-mongod.--enableMajorityReadConcern"> <code class="leafygreen-ui-1l06pbn"> --enableMajorityReadConcern false </code> </a> to disable read concern <code class="leafygreen-ui-1l06pbn"> majority </code> . <!-- --> See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-sharded-cluster-mmapv1-wt-4.0-psa" target="_self"> <span> PSA 3-member Architecture </span> </a> . </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --storageEngine wiredTiger --dbpath &lt;newwiredtigerdbpath&gt; --replSet &lt;replsetname&gt; --bind_ip localhost,&lt;hostname(s)|ip&gt; --enableMajorityReadConcern false","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --storageEngine wiredTiger --dbpath &lt;newWiredTigerDBPath&gt; --replSet &lt;replSetName&gt; --bind_ip localhost,&lt;hostname(s)|ip address(es)&gt; --enableMajorityReadConcern <span class="lg-highlight-literal">false</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Since no data exists in the <code class="leafygreen-ui-1l06pbn"> --dbpath </code> , the <code class="leafygreen-ui-1l06pbn"> mongod </code> will perform an <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/resync-replica-set-member/#std-label-resync-replica-member"> initial sync </a> . The length of the initial sync process depends on the size of the database and network connection between members of the replica set. </p> <p class="leafygreen-ui-1kp3ins"> You can also specify the options in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/"> configuration file </a> . To specify the storage engine, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-storage.engine"> <code class="leafygreen-ui-1l06pbn"> storage.engine </code> </a> setting. </p> </section> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Repeat the procedure for the other shards. </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/core/timeseries/timeseries-compression/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Time Series Compression <a class="headerlink leafygreen-ui-1kepx47" href="#time-series-compression" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="time-series-compression"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#default-compression-algorithm" target="_self"> <span> Default Compression Algorithm </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#column-compression" target="_self"> <span> Column Compression </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self"> <span> Learn More </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> This page describes how MongoDB compresses data in time series collections, and how you can optimize compression. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Default Compression Algorithm <a class="headerlink leafygreen-ui-1kepx47" href="#default-compression-algorithm" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="default-compression-algorithm"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Time series collections use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-zstd"> zstd </a> compression, which differs from the global default compression algorithm, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-snappy"> snappy <!-- --> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Column Compression <a class="headerlink leafygreen-ui-1kepx47" href="#column-compression" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="column-compression"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.2, time series collections use <strong> column compression </strong> . Column compression adds a number of innovations that work together to significantly improve practical compression, reduce your data's overall storage on disk, and improve read performance. </p> <p class="leafygreen-ui-1kp3ins"> These enhancements further reduce size of data on disk when compressed with <code class="leafygreen-ui-1l06pbn"> zstd </code> , and also significantly reduce space used in the WiredTiger cache. </p> <p class="leafygreen-ui-1kp3ins"> The types of compression introduced are: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Delta Encoding </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Object compression </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Array compression (starting in MongoDB 6.0) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Run Length encoding (RLE) </p> </li> </ul> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Delta Encoding (Delta Compression) <a class="headerlink leafygreen-ui-1kepx47" href="#delta-encoding--delta-compression-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="delta-encoding--delta-compression-"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Delta Encoding takes advantage of the data in your time series collection having time-series characteristics. Instead of storing absolute values, Delta Encoding assumes that the measurements will not change rapidly between each other. This approach reduces the amount of information required by only storing the difference between measurements. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Delta of Delta Encoding (Delta of Delta Compression) <a class="headerlink leafygreen-ui-1kepx47" href="#delta-of-delta-encoding--delta-of-delta-compression-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="delta-of-delta-encoding--delta-of-delta-compression-"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> With data that increases monotonically, Delta of Delta Encoding can further minimize the size of the number stored by calculating a delta of the delta itself. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Object and Array Compression <a class="headerlink leafygreen-ui-1kepx47" href="#object-and-array-compression" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="object-and-array-compression"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Column compression ensures that if you are using objects and arrays in your documents, you receive the same compression benefits had those embedded fields existed at the root level of your document. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To learn how to optimize compression, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/timeseries/timeseries-best-practices/#std-label-tsc-best-practice-optimize-compression"> Compression Best Practices <!-- --> . </a> </p> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/equality-sort-range-rule/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> The ESR (Equality, Sort, Range) Rule <a class="headerlink leafygreen-ui-1kepx47" href="#the-esr--equality--sort--range--rule" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="the-esr--equality--sort--range--rule"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#equality" target="_self"> <span> Equality </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#sort" target="_self"> <span> Sort </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#range" target="_self"> <span> Range </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#additional-considerations" target="_self"> <span> Additional Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self"> <span> Learn More </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> An index that references multiple fields is a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-compound/#std-label-index-type-compound"> compound index </a> . Compound indexes can dramatically improve query response times. </p> <p class="leafygreen-ui-1kp3ins"> Index keys correspond to document fields. In most cases, applying the ESR (Equality, Sort, Range) Rule to arrange the index keys helps to create a more efficient <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-compound/#std-label-index-type-compound"> compound index <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> This page introduces the ESR Rule. For more information on optimizing queries, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/explain/#mongodb-dbcommand-dbcmd.explain"> <code class="leafygreen-ui-1l06pbn"> explain </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/query-plans/#std-label-query-plans-query-optimization"> Query Plans <!-- --> . </a> </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To force MongoDB to use a particular index, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.hint/#std-label-cursor-hint"> cursor.hint() </a> when testing indexes. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-esr-rule-equality"> </span> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Equality <a class="headerlink leafygreen-ui-1kepx47" href="#equality" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="equality"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> "Equality" refers to an exact match on a single value. The following exact match queries scan the <code class="leafygreen-ui-1l06pbn"> cars </code> collection for documents whose <code class="leafygreen-ui-1l06pbn"> model </code> field exactly matches <code class="leafygreen-ui-1l06pbn"> Cordoba </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cars.find( { model: \"Cordoba\" } )\ndb.cars.find( { model: { $eq: \"Cordoba\" } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cars</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">model</span>: <span class="lg-highlight-string">"Cordoba"</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cars</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">model</span>: <!-- -->{ <span class="lg-highlight-attr">$eq</span>: <span class="lg-highlight-string">"Cordoba"</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Index searches make efficient use of exact matches to limit the number of documents that need to be examined to complete a query. Put the fields that require exact matches first in your index. </p> <p class="leafygreen-ui-1kp3ins"> An index may have multiple keys for queries with exact matches. The index keys for equality matches can appear in any order. However, to satisfy an equality match with the index, all of the index keys for exact matches must come before any other index fields. MongoDB's search algorithm eliminates any need to arrange the exact match fields in a particular order. </p> <p class="leafygreen-ui-1kp3ins"> Exact matches should be selective. To reduce the number of index keys scanned, ensure equality tests eliminate at least 90% of possible document matches. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-esr-rule-sort"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Sort <a class="headerlink leafygreen-ui-1kepx47" href="#sort" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="sort"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> "Sort" determines the order for results. Sort follows equality matches because the equality matches reduce the number of documents that need to be sorted. Sorting after the equality matches also allows MongoDB to do a non-blocking sort. </p> <p class="leafygreen-ui-1kp3ins"> An index can support sort operations when the query fields are a subset of the index keys. Sort operations on a subset of the index keys are only supported if the query includes equality conditions for all of the prefix keys that precede the sort keys. For more information, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/sort-results-with-indexes/#std-label-sort-index-nonprefix-subset"> Sort and Non-prefix Subset of an Index <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The following example queries the <code class="leafygreen-ui-1l06pbn"> cars </code> collection. The output is sorted by <code class="leafygreen-ui-1l06pbn"> model </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cars.find( { manufacturer: \"GM\" } ).sort( { model: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cars</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">manufacturer</span>: <span class="lg-highlight-string">"GM"</span> } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">model</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To improve query performance, create an index on the <code class="leafygreen-ui-1l06pbn"> manufacturer </code> and <code class="leafygreen-ui-1l06pbn"> model </code> fields: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cars.createIndex( { manufacturer: 1, model: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cars</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">manufacturer</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">model</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> manufacturer </code> is the first key because it is an equality match. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> model </code> is indexed in the same order ( <code class="leafygreen-ui-1l06pbn"> 1 </code> ) as the query. </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-esr-rule-range"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Range <a class="headerlink leafygreen-ui-1kepx47" href="#range" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="range"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> "Range" filters scan fields. The scan doesn't require an exact match, which means range filters are loosely bound to index keys. To improve query efficiency, limit the range bounds and use equality matches to reduce the number of documents to scan. </p> <p class="leafygreen-ui-1kp3ins"> Range filters resemble the following: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cars.find( { price: { $gte: 15000} } )\ndb.cars.find( { age: { $lt: 10 } } )\ndb.cars.find( { priorAccidents: { $ne: null } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cars</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">price</span>: <!-- -->{ <span class="lg-highlight-attr">$gte</span>: <span class="lg-highlight-number">15000</span>} } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cars</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">age</span>: <!-- -->{ <span class="lg-highlight-attr">$lt</span>: <span class="lg-highlight-number">10</span> } } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cars</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">priorAccidents</span>: <!-- -->{ <span class="lg-highlight-attr">$ne</span>: <span class="lg-highlight-literal">null</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> MongoDB cannot perform an index sort on the results of a range filter. Place the range filter after the sort predicate so MongoDB can use a non-blocking index sort. For more information on blocking sorts, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.allowDiskUse/#mongodb-method-cursor.allowDiskUse"> <code class="leafygreen-ui-1l06pbn"> cursor.allowDiskUse() </code> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Additional Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#additional-considerations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="additional-considerations"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Inequality operators such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/ne/#mongodb-query-op.-ne"> <code class="leafygreen-ui-1l06pbn"> $ne </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/nin/#mongodb-query-op.-nin"> <code class="leafygreen-ui-1l06pbn"> $nin </code> </a> are range operators, not equality operators. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/regex/#mongodb-query-op.-regex"> <code class="leafygreen-ui-1l06pbn"> $regex </code> </a> is a range operator. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/in/#mongodb-query-op.-in"> <code class="leafygreen-ui-1l06pbn"> $in </code> : </a> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When <code class="leafygreen-ui-1l06pbn"> $in </code> is used alone, it is an equality operator that performs a series of equality matches. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When <code class="leafygreen-ui-1l06pbn"> $in </code> is used with <code class="leafygreen-ui-1l06pbn"> .sort() </code> : </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> $in </code> has less than 200 array elements, the elements are expanded and then merged in the sort order specified for the index. This improves performance for small arrays. <code class="leafygreen-ui-1l06pbn"> $in </code> is similar to an equality predicate with ESR. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> $in </code> has 200 elements or more, the elements are ordered like a range operator. In this scenario, the performance improvement for small arrays isn't realized. It isn't possible for the subsequent fields in the index to provide a sort, and <code class="leafygreen-ui-1l06pbn"> $in </code> is similar to a range predicate with ESR. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If you typically use <code class="leafygreen-ui-1l06pbn"> $ins </code> with small arrays, include <code class="leafygreen-ui-1l06pbn"> $ins </code> earlier in the index specification. If you typically use large arrays, include <code class="leafygreen-ui-1l06pbn"> $ins </code> where you would include a range predicate. </p> </li> </ul> </li> </ul> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The 200 limit is subject to change and is not guaranteed to stay the same for all MongoDB versions. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following query searches the <code class="leafygreen-ui-1l06pbn"> cars </code> collection for vehicles manufactured by Ford that cost more than $15,000 dollars. The results are sorted by model: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.cars.find(\n {\n manufacturer: 'Ford',\n cost: { $gt: 15000 }\n } ).sort( { model: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">cars</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">manufacturer</span>: <span class="lg-highlight-string">'Ford'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">cost</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">15000</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">model</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The query contains all the elements of the ESR Rule: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> manufacturer: 'Ford' </code> is an equality based match </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> cost: { $gt: 15000 } </code> is a range based match, and </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> model </code> is used for sorting </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> Following the ESR rule, the optimal index for the example query is: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ manufacturer: 1, model: 1, cost: 1 }","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">manufacturer</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">model</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">cost</span>: <span class="lg-highlight-number">1</span> }</td></tr></tbody></table></code></pre> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/data-modeling/schema-design-process/create-indexes/#std-label-create-indexes-to-support-queries"> Create Indexes to Support Your Queries </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/sort-results-with-indexes/#std-label-index-sort"> Use Indexes to Sort Query Results </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/create-queries-that-ensure-selectivity/#std-label-index-selectivity"> Create Indexes to Ensure Query Selectivity </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/replSetAbortPrimaryCatchUp/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> replSetAbortPrimaryCatchUp <a class="headerlink leafygreen-ui-1kepx47" href="#replsetabortprimarycatchup" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="replsetabortprimarycatchup"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> replSetAbortPrimaryCatchUp </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.replSetAbortPrimaryCatchUp" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-dbcommand-dbcmd.replSetAbortPrimaryCatchUp"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> replSetAbortPrimaryCatchUp </code> command forces the elected <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> member of the replica set to abort sync (catch up) then complete the transition to primary. </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand(\n {\n replSetAbortPrimaryCatchUp: 1\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">replSetAbortPrimaryCatchUp</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/core/indexes/index-types/index-text/text-index-restrictions/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Text Index Restrictions on Self-Managed Deployments <a class="headerlink leafygreen-ui-1kepx47" href="#text-index-restrictions-on-self-managed-deployments" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="text-index-restrictions-on-self-managed-deployments"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#one-text-index-per-collection" target="_self"> <span> One Text Index per Collection </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#text-search-and-hints" target="_self"> <span> Text Search and Hints </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#text-search-and-phrases" target="_self"> <span> Text Search and Phrases </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#text-index-and-sort" target="_self"> <span> Text Index and Sort </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compound-text-index" target="_self"> <span> Compound Text Index </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#collation-option" target="_self"> <span> Collation Option </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> Text indexes have these restrictions: </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> One Text Index per Collection <a class="headerlink leafygreen-ui-1kepx47" href="#one-text-index-per-collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="one-text-index-per-collection"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A collection can have at most one text index. </p> <p class="leafygreen-ui-1kp3ins"> Atlas Search (available in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/atlas/database?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> ) supports multiple full-text search indexes on a single collection. To learn more, see the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-search/" target="_self"> <span> Atlas Search documentation <!-- --> . </span> </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Text Search and Hints <a class="headerlink leafygreen-ui-1kepx47" href="#text-search-and-hints" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="text-search-and-hints"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If a query includes a <code class="leafygreen-ui-1l06pbn"> $text </code> expression, you cannot use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.hint/#mongodb-method-cursor.hint"> <code class="leafygreen-ui-1l06pbn"> hint() </code> </a> to specify which index to use for the query. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Text Search and Phrases <a class="headerlink leafygreen-ui-1kepx47" href="#text-search-and-phrases" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="text-search-and-phrases"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> If the <code class="leafygreen-ui-1l06pbn"> $search </code> string of a <code class="leafygreen-ui-1l06pbn"> $text </code> operation includes a phrase and individual terms, <code class="leafygreen-ui-1l06pbn"> $text </code> only matches the documents that include the phrase. </p> <p class="leafygreen-ui-1kp3ins"> You cannot use the <code class="leafygreen-ui-1l06pbn"> $text </code> operator with multiple phrases. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-text-index-and-sort"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Text Index and Sort <a class="headerlink leafygreen-ui-1kepx47" href="#text-index-and-sort" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="text-index-and-sort"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Text indexes cannot improve performance for sort operations. This restriction applies to both single-field and compound text indexes. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-text-index-compound-restrictions"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compound Text Index <a class="headerlink leafygreen-ui-1kepx47" href="#compound-text-index" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compound-text-index"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-compound/#std-label-index-type-compound"> compound index </a> can include a text index key in combination with ascending and descending index keys. However, compound text indexes have these restrictions: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A compound text index cannot include any other special index types, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-multikey/#std-label-index-type-multi-key"> multikey </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-geospatial/#std-label-geospatial-index"> geospatial </a> index fields. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If the compound text index includes keys <strong> preceding </strong> the text index key, to use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/text/#mongodb-query-op.-text"> <code class="leafygreen-ui-1l06pbn"> $text </code> </a> , the query predicate must include <strong> equality match conditions </strong> on the preceding keys. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> When you create a compound text index, all text index keys must be listed adjacently in the index specification document. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For examples of compound text indexes, see these pages: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/create-text-index/#std-label-compound-text-index-example"> Create a Compound Text Index </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/limit-number-of-items-scanned-for-text-search/#std-label-limit-entries-scanned"> Limit Number of Text Index Entries Scanned on Self-Managed Deployments </a> </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Collation Option <a class="headerlink leafygreen-ui-1kepx47" href="#collation-option" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="collation-option"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Text indexes only support binary comparison, and do not support the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation/#std-label-collation"> collation </a> option. Binary comparison compares the numeric Unicode value of each character in each string, and does not account for letter case or accent marks. </p> <p class="leafygreen-ui-1kp3ins"> To create a text index on a collection that has a non-simple collation, you must explicitly specify <code class="leafygreen-ui-1l06pbn"> { collation: { locale: "simple" } } </code> when you create the index. </p> <p class="leafygreen-ui-1kp3ins"> For example, consider a collection named <code class="leafygreen-ui-1l06pbn"> collationTest </code> with a collation of <code class="leafygreen-ui-1l06pbn"> { locale: "en" } </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection(\n \"collationTest\",\n {\n collation: { locale: \"en\" }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"collationTest"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"en"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> To create a text index on the <code class="leafygreen-ui-1l06pbn"> collationTest </code> collection, you must specify <code class="leafygreen-ui-1l06pbn"> { collation: { locale: "simple" } } </code> . The following command creates a text index on the <code class="leafygreen-ui-1l06pbn"> quotes </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.collationTest.createIndex(\n {\n quotes: \"text\"\n },\n {\n collation: { locale: \"simple\" }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">collationTest</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quotes</span>: <span class="lg-highlight-string">"text"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"simple"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/query/gt/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $gt <a class="headerlink leafygreen-ui-1kepx47" href="#-gt" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-gt"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="query"> <dt> <code class="leafygreen-ui-1l06pbn"> $gt </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-query-op.-gt" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-query-op.-gt"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-gt" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $gt </code> </span> </a> selects those documents where the value of the specified field is greater than (i.e. <code class="leafygreen-ui-1l06pbn"> &gt; </code> ) the specified value. </p> <p class="leafygreen-ui-1kp3ins"> For most data types, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query-comparison/"> comparison operators </a> only perform comparisons on fields where the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-types/#std-label-bson-types"> BSON type </a> matches the query value's type. MongoDB supports limited cross-BSON comparison through <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#std-label-type-bracketing"> Type Bracketing <!-- --> . </a> </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can use <code class="leafygreen-ui-1l06pbn"> $gt </code> for deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-gt" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $gt </code> </span> </a> operator has the following form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ field: { $gt: value } }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">field</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <!-- -->value } }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following examples use the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection. Create the collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.insertMany( [\n {\n \"item\": \"nuts\", \"quantity\": 30,\n \"carrier\": { \"name\": \"Shipit\", \"fee\": 3 }\n },\n {\n \"item\": \"bolts\", \"quantity\": 50,\n \"carrier\": { \"name\": \"Shipit\", \"fee\": 4 }\n },\n {\n \"item\": \"washers\", \"quantity\": 10,\n \"carrier\": { \"name\": \"Shipit\", \"fee\": 1 }\n }\n] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>( <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"nuts"</span>, <span class="lg-highlight-string">"quantity"</span>: <span class="lg-highlight-number">30</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"carrier"</span>: <!-- -->{ <span class="lg-highlight-string">"name"</span>: <span class="lg-highlight-string">"Shipit"</span>, <span class="lg-highlight-string">"fee"</span>: <span class="lg-highlight-number">3</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"bolts"</span>, <span class="lg-highlight-string">"quantity"</span>: <span class="lg-highlight-number">50</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"carrier"</span>: <!-- -->{ <span class="lg-highlight-string">"name"</span>: <span class="lg-highlight-string">"Shipit"</span>, <span class="lg-highlight-string">"fee"</span>: <span class="lg-highlight-number">4</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"item"</span>: <span class="lg-highlight-string">"washers"</span>, <span class="lg-highlight-string">"quantity"</span>: <span class="lg-highlight-number">10</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"carrier"</span>: <!-- -->{ <span class="lg-highlight-string">"name"</span>: <span class="lg-highlight-string">"Shipit"</span>, <span class="lg-highlight-string">"fee"</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Match Document Fields <a class="headerlink leafygreen-ui-1kepx47" href="#match-document-fields" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="match-document-fields"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Select all documents in the <code class="leafygreen-ui-1l06pbn"> inventory </code> collection where <code class="leafygreen-ui-1l06pbn"> quantity </code> is greater than <code class="leafygreen-ui-1l06pbn"> 20 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.find( { quantity: { $gt: 20 } } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">quantity</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">20</span> } } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Example output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: ObjectId(\"61ba25cbfe687fce2f042414\"),\n item: 'nuts',\n quantity: 30,\n carrier: { name: 'Shipit', fee: 3 }\n},\n{\n _id: ObjectId(\"61ba25cbfe687fce2f042415\"),\n item: 'bolts',\n quantity: 50,\n carrier: { name: 'Shipit', fee: 4 }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"61ba25cbfe687fce2f042414"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'nuts'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">30</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">carrier</span>: <!-- -->{ <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">'Shipit'</span>, <span class="lg-highlight-attr">fee</span>: <span class="lg-highlight-number">3</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"61ba25cbfe687fce2f042415"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'bolts'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">50</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">carrier</span>: <!-- -->{ <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">'Shipit'</span>, <span class="lg-highlight-attr">fee</span>: <span class="lg-highlight-number">4</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Perform an Update Based on Embedded Document Fields <a class="headerlink leafygreen-ui-1kepx47" href="#perform-an-update-based-on-embedded-document-fields" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="perform-an-update-based-on-embedded-document-fields"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example sets the <code class="leafygreen-ui-1l06pbn"> price </code> field based on a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-query-op.-gt" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $gt </code> </span> </a> comparison against a field in an embedded document. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.inventory.updateOne(\n { \"carrier.fee\": { $gt: 2 } }, { $set: { \"price\": 9.99 } }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">inventory</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"carrier.fee"</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-number">2</span> } }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">$set</span>: <!-- -->{ <span class="lg-highlight-string">"price"</span>: <span class="lg-highlight-number">9.99</span> } }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Example output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: ObjectId(\"61ba3ec9fe687fce2f042417\"),\n item: 'nuts',\n quantity: 30,\n carrier: { name: 'Shipit', fee: 3 },\n price: 9.99\n},\n{\n _id: ObjectId(\"61ba3ec9fe687fce2f042418\"),\n item: 'bolts',\n quantity: 50,\n carrier: { name: 'Shipit', fee: 4 }\n},\n{\n _id: ObjectId(\"61ba3ec9fe687fce2f042419\"),\n item: 'washers',\n quantity: 10,\n carrier: { name: 'Shipit', fee: 1 }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"61ba3ec9fe687fce2f042417"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'nuts'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">30</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">carrier</span>: <!-- -->{ <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">'Shipit'</span>, <span class="lg-highlight-attr">fee</span>: <span class="lg-highlight-number">3</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">9.99</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"61ba3ec9fe687fce2f042418"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'bolts'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">50</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">carrier</span>: <!-- -->{ <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">'Shipit'</span>, <span class="lg-highlight-attr">fee</span>: <span class="lg-highlight-number">4</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"61ba3ec9fe687fce2f042419"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">item</span>: <span class="lg-highlight-string">'washers'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">quantity</span>: <span class="lg-highlight-number">10</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">carrier</span>: <!-- -->{ <span class="lg-highlight-attr">name</span>: <span class="lg-highlight-string">'Shipit'</span>, <span class="lg-highlight-attr">fee</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> This <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#mongodb-method-db.collection.updateOne"> <code class="leafygreen-ui-1l06pbn"> updateOne() </code> </a> operation searches for an embedded document, <code class="leafygreen-ui-1l06pbn"> carrier </code> , with a subfield named <code class="leafygreen-ui-1l06pbn"> fee </code> . It sets <code class="leafygreen-ui-1l06pbn"> { price: 9.99 } </code> in the first document it finds where <code class="leafygreen-ui-1l06pbn"> fee </code> has a value greater than 2. </p> <p class="leafygreen-ui-1kp3ins"> To set the value of the <code class="leafygreen-ui-1l06pbn"> price </code> field in <em> all </em> documents where <code class="leafygreen-ui-1l06pbn"> carrier.fee </code> is greater than 2, use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateMany/#mongodb-method-db.collection.updateMany"> <code class="leafygreen-ui-1l06pbn"> updateMany() </code> . </a> </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find"> <code class="leafygreen-ui-1l06pbn"> find() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/set/#mongodb-update-up.-set"> <code class="leafygreen-ui-1l06pbn"> $set </code> </a> </p> </li> </ul> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/js-role-management/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Role Management Methods <a class="headerlink leafygreen-ui-1kepx47" href="#role-management-methods" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="role-management-methods"> </div> </a> </h1> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> For details on a specific method, including syntax and examples, click on the link to the method's reference page. </p> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:30%"/> <col style="width:70%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Name </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createRole/#mongodb-method-db.createRole"> <code class="leafygreen-ui-1l06pbn"> db.createRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Creates a role and specifies its privileges. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.dropRole/#mongodb-method-db.dropRole"> <code class="leafygreen-ui-1l06pbn"> db.dropRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deletes a user-defined role. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.dropAllRoles/#mongodb-method-db.dropAllRoles"> <code class="leafygreen-ui-1l06pbn"> db.dropAllRoles() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Deletes all user-defined roles associated with a database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getRole/#mongodb-method-db.getRole"> <code class="leafygreen-ui-1l06pbn"> db.getRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns information for the specified role. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.getRoles/#mongodb-method-db.getRoles"> <code class="leafygreen-ui-1l06pbn"> db.getRoles() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Returns information for all the user-defined roles in a database. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.grantPrivilegesToRole/#mongodb-method-db.grantPrivilegesToRole"> <code class="leafygreen-ui-1l06pbn"> db.grantPrivilegesToRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Assigns privileges to a user-defined role. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.revokePrivilegesFromRole/#mongodb-method-db.revokePrivilegesFromRole"> <code class="leafygreen-ui-1l06pbn"> db.revokePrivilegesFromRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes the specified privileges from a user-defined role. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.grantRolesToRole/#mongodb-method-db.grantRolesToRole"> <code class="leafygreen-ui-1l06pbn"> db.grantRolesToRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Specifies roles from which a user-defined role inherits privileges. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.revokeRolesFromRole/#mongodb-method-db.revokeRolesFromRole"> <code class="leafygreen-ui-1l06pbn"> db.revokeRolesFromRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Removes inherited roles from a role. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.updateRole/#mongodb-method-db.updateRole"> <code class="leafygreen-ui-1l06pbn"> db.updateRole() </code> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Updates a user-defined role. </div> </div> </td> </tr> </tbody> </table> </div> </section>
https://www.mongodb.com/docs/manual/reference/method/ClientEncryption.encrypt/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> ClientEncryption.encrypt() <a class="headerlink leafygreen-ui-1kepx47" href="#clientencryption.encrypt--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="clientencryption.encrypt--"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self"> <span> Learn More </span> </a> </li> </ul> </div> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> ClientEncryption.encrypt(keyId, value, algorithm or encOptions) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-ClientEncryption.encrypt" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-ClientEncryption.encrypt"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-ClientEncryption.encrypt" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> ClientEncryption.encrypt() </code> </span> </a> encrypts the <code class="leafygreen-ui-1l06pbn"> value </code> using the specified <code class="leafygreen-ui-1l06pbn"> keyId </code> and the algorithm specified by <code class="leafygreen-ui-1l06pbn"> algorithm </code> or <code class="leafygreen-ui-1l06pbn"> encOptions </code> . <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-ClientEncryption.encrypt" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> encrypt() </code> </span> </a> supports explicit (manual) encryption of field values. </p> <table class="css-11h39yh e1nex8bq0"> <colgroup> <col class="field-name"/> <col class="field-body"/> </colgroup> <tbody> <tr class="css-x8snli"> <th> Returns <!-- --> : </th> <td> A <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Binary"> <code class="leafygreen-ui-1l06pbn"> binary data </code> </a> object with <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/subtype6.rst" rel="noopener noreferrer"> <span> subtype 6 </span> <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16"> <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor"> </path> <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor"> </path> </svg> </a> . </td> </tr> </tbody> </table> </dd> </dl> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"clientEncryption = db.getMongo().getClientEncryption()\n\nclientEncryption.encrypt(\n keyId,\n value,\n algorithm or encOptions,\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">clientEncryption <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">getMongo</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">getClientEncryption</span>(<!-- -->)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">clientEncryption.<span class="lg-highlight-title lg-highlight-function">encrypt</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->keyId<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->value<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->algorithm or encOptions<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> keyId </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> UUID </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> The data encryption key to use for encrypting the <code class="leafygreen-ui-1l06pbn"> value </code> . </p> <p class="leafygreen-ui-1kp3ins"> The <span class="leafygreen-ui-vm4wms" tabindex="0"> UUID </span> is a BSON <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Binary"> <code class="leafygreen-ui-1l06pbn"> binary data </code> </a> object with subtype <code class="leafygreen-ui-1l06pbn"> 4 </code> that identifies a specific data encryption key. If the data encryption key does not exist in the key vault configured for the database connection, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-ClientEncryption.encrypt" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> encrypt() </code> </span> </a> returns an error. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/keys-key-vaults/#std-label-qe-reference-key-vault"> Key Vault Collections </a> for more information on key vaults and data encryption keys. </p> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> value </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-encrypt-bson-types" target="_self"> <span> Unsupported BSON Types <!-- --> . </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The value to encrypt. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> algorithm </code> or <code class="leafygreen-ui-1l06pbn"> encOptions </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string or document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To explicitly encrypt fields with <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/fundamentals/manual-encryption/#std-label-csfle-fundamentals-manual-encryption"> Client-Side Field Level Encryption <!-- --> : </a> </p> <p class="leafygreen-ui-1kp3ins"> Specify the <code class="leafygreen-ui-1l06pbn"> algorithm </code> as a string or <code class="leafygreen-ui-1l06pbn"> encOptions </code> as a document containing the field <code class="leafygreen-ui-1l06pbn"> algorithm </code> . </p> <p class="leafygreen-ui-1kp3ins"> The supported algorithms are: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> AEAD_AES_256_CBC_HMAC_SHA_512-Random </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For examples, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-set-csfle-algorithm" target="_self"> <span> Set the Client-Side Field Level Encryption Algorithm <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> For complete documentation on the supported encryption algorithms, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/fundamentals/encryption-algorithms/#std-label-field-level-encryption-algorithms"> Fields and Encryption Types <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To explicitly encrypt fields with <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/manual-encryption/#std-label-qe-fundamentals-manual-encryption"> Queryable Encryption <!-- --> : </a> </p> <p class="leafygreen-ui-1kp3ins"> Specify the <code class="leafygreen-ui-1l06pbn"> algorithm </code> as a string or <code class="leafygreen-ui-1l06pbn"> encOptions </code> as a document containing the fields: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> algorithm </code> : The encryption algorithm to use for encrypting the <code class="leafygreen-ui-1l06pbn"> value </code> . The supported algorithms are: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> Indexed </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> Unindexed </code> </p> </li> </ul> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> contentionFactor </code> : Required when <code class="leafygreen-ui-1l06pbn"> algorithm </code> is set to <code class="leafygreen-ui-1l06pbn"> Indexed </code> . Related to the frequency of the values for this field. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> queryType </code> : The only query type currently supported is <code class="leafygreen-ui-1l06pbn"> "equality" </code> . <code class="leafygreen-ui-1l06pbn"> queryType </code> must be set when algorithm is not <code class="leafygreen-ui-1l06pbn"> Indexed </code> . </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For examples, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-set-qe-algorithm" target="_self"> <span> Set the Queryable Encryption Algorithm <!-- --> . </span> </a> </p> <p class="leafygreen-ui-1kp3ins"> For details on the supported encryption algorithms, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/manual-encryption/#std-label-qe-fundamentals-man-enc-algorithm-choice"> Algorithm Choice <!-- --> . </a> </p> </li> </ul> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> client-side field level and queryable encryption methods require a database connection configured for client-side encryption. If the current database connection was not initiated with client-side field level encryption enabled, either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> constructor from the <code class="leafygreen-ui-1l06pbn"> mongosh </code> to establish a connection with the required client-side field level encryption options. The <code class="leafygreen-ui-1l06pbn"> Mongo() </code> method supports the following Key Management Service (KMS) providers for Customer Master Key (CMK) management: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-aws"> Amazon Web Services KMS </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-azure"> Azure Key Vault </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-gcp"> Google Cloud Platform KMS </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-local"> Locally Managed Key </a> </p> </li> </ul> </li> </ul> <p class="leafygreen-ui-1kp3ins"> <em> or </em> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Use the <code class="leafygreen-ui-1l06pbn"> mongosh </code> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-label-mongosh-client-side-field-level-encryption-options" target="_self"> <span> command line options </span> </a> to establish a connection with the required options. The command line options only support the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers-aws"> Amazon Web Services KMS </a> provider for CMK management. </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-encrypt-bson-types"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Unsupported BSON Types <a class="headerlink leafygreen-ui-1kepx47" href="#unsupported-bson-types" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="unsupported-bson-types"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You cannot use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-ClientEncryption.encrypt" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> encrypt() </code> </span> </a> to encrypt values with the following BSON types: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> minKey </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> maxKey </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> null </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> undefined </code> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> If encrypting a field using <code class="leafygreen-ui-1l06pbn"> AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic </code> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-ClientEncryption.encrypt" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> encrypt() </code> </span> </a> does <em> not </em> support the following BSON types: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> double </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> decimal128 </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> bool </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> object </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> array </code> </p> </li> </ul> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <span class="leafygreen-ui-1qnjd6d" id="std-label-set-csfle-algorithm"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Client-Side Field Level Encryption <a class="headerlink leafygreen-ui-1kepx47" href="#client-side-field-level-encryption" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="client-side-field-level-encryption"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example uses a locally managed KMS for the client-side field level encryption configuration. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Start mongoshRun:--nodb means don't connect to a database.Generate a Key StringGenerate a base 64 96-byte string:Create an Encryption Options ObjectTo create a client-side field level encryption options object, use\nthe TEST_LOCAL_KEY string from the previous step:Create an Encrypted Client ObjectTo create an encrypted client object, use the Mongo()\nconstructor. Replace the mongodb://myMongo.example.net URI with\nthe connection string URI for the target\ncluster. For example:","name":"Create Your Encrypted Connection"},{"@type":"HowToStep","text":"Retrieve the ClientEncryption object\nand use the ClientEncryption.encrypt() method to encrypt\na value using a specific data encryption key UUID and\nencryption algorithm:You can also specify the algorithm using a document with an\nalgorithm field:","name":"Encrypt Your Data"}],"name":"Client-Side Field Level Encryption","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Create Your Encrypted Connection <a class="headerlink leafygreen-ui-1kepx47" href="#create-your-encrypted-connection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-your-encrypted-connection"> </div> </a> </h4> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Start mongosh </p> <p class="leafygreen-ui-1kp3ins"> Run: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh --nodb","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh --nodb</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> --nodb </code> means don't connect to a database. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Generate a Key String </p> <p class="leafygreen-ui-1kp3ins"> Generate a base 64 96-byte string: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"const TEST_LOCAL_KEY = require(\"crypto\").randomBytes(96).toString(\"base64\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> <span class="lg-highlight-variable lg-highlight-constant">TEST_LOCAL_KEY</span> <!-- -->= <span class="lg-highlight-built_in">require</span>(<span class="lg-highlight-string">"crypto"</span>).<span class="lg-highlight-title lg-highlight-function">randomBytes</span>(<span class="lg-highlight-number">96</span>).<span class="lg-highlight-title lg-highlight-function">toString</span>(<span class="lg-highlight-string">"base64"</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create an Encryption Options Object </p> <p class="leafygreen-ui-1kp3ins"> To create a client-side field level encryption options object, use the <code class="leafygreen-ui-1l06pbn"> TEST_LOCAL_KEY </code> string from the previous step: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":" var autoEncryptionOpts = {\n \"keyVaultNamespace\" : \"encryption.__dataKeys\",\n \"kmsProviders\" : {\n \"local\" : {\n \"key\" : BinData(0, TEST_LOCAL_KEY)\n }\n }\n }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">var</span> autoEncryptionOpts <!-- -->= <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keyVaultNamespace"</span> <!-- -->: <span class="lg-highlight-string">"encryption.__dataKeys"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"kmsProviders"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"local"</span> <!-- -->: <!-- -->{</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"key"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">BinData</span>(<span class="lg-highlight-number">0</span>, <span class="lg-highlight-variable lg-highlight-constant">TEST_LOCAL_KEY</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create an Encrypted Client Object </p> <p class="leafygreen-ui-1kp3ins"> To create an encrypted client object, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> constructor. Replace the <code class="leafygreen-ui-1l06pbn"> mongodb://myMongo.example.net </code> URI with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string/#std-label-mongodb-uri"> connection string URI </a> for the target cluster. For example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"encryptedClient = Mongo(\n \"mongodb://myMongo.example.net:27017/?replSetName=myMongo\",\n autoEncryptionOpts\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">encryptedClient <!-- -->= <span class="lg-highlight-title lg-highlight-class">Mongo</span>(</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"mongodb://myMongo.example.net:27017/?replSetName=myMongo"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->autoEncryptionOpts</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Encrypt Your Data <a class="headerlink leafygreen-ui-1kepx47" href="#encrypt-your-data" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="encrypt-your-data"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Retrieve the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/getClientEncryption/#mongodb-method-getClientEncryption"> <code class="leafygreen-ui-1l06pbn"> ClientEncryption </code> </a> object and use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-ClientEncryption.encrypt" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> ClientEncryption.encrypt() </code> </span> </a> method to encrypt a value using a specific data encryption key <code class="leafygreen-ui-1l06pbn"> UUID </code> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/fundamentals/encryption-algorithms/#std-label-field-level-encryption-algorithms"> encryption algorithm <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"clientEncryption = encryptedClient.getClientEncryption();\n\nclientEncryption.encrypt(\n UUID(\"64e2d87d-f168-493c-bbdf-a394535a2cb9\"),\n \"123-45-6789\",\n \"AEAD_AES_256_CBC_HMAC_SHA_512-Random\"\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">clientEncryption <!-- -->= <!-- -->encryptedClient.<span class="lg-highlight-title lg-highlight-function">getClientEncryption</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">clientEncryption.<span class="lg-highlight-title lg-highlight-function">encrypt</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-function">UUID</span>(<span class="lg-highlight-string">"64e2d87d-f168-493c-bbdf-a394535a2cb9"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"123-45-6789"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"AEAD_AES_256_CBC_HMAC_SHA_512-Random"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> You can also specify the algorithm using a document with an <code class="leafygreen-ui-1l06pbn"> algorithm </code> field: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"clientEncryption = encryptedClient.getClientEncryption();\n\nclientEncryption.encrypt(\n UUID(\"64e2d87d-f168-493c-bbdf-a394535a2cb9\"),\n \"123-45-6789\",\n { algorithm: \"AEAD_AES_256_CBC_HMAC_SHA_512-Random\" }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">clientEncryption <!-- -->= <!-- -->encryptedClient.<span class="lg-highlight-title lg-highlight-function">getClientEncryption</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">clientEncryption.<span class="lg-highlight-title lg-highlight-function">encrypt</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-title lg-highlight-function">UUID</span>(<span class="lg-highlight-string">"64e2d87d-f168-493c-bbdf-a394535a2cb9"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"123-45-6789"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">algorithm</span>: <span class="lg-highlight-string">"AEAD_AES_256_CBC_HMAC_SHA_512-Random"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> </div> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Example Results <a class="headerlink leafygreen-ui-1kepx47" href="#example-results" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example-results"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> If successful, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-ClientEncryption.encrypt" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> encrypt() </code> </span> </a> returns the encrypted value: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"BinData(6,\"AmTi2H3xaEk8u9+jlFNaLLkC3Q/+kmwDbbWrq+h9nuv9W+u7A5a0UnpULBNZH+Q21fAztPpU09wpKPrju9dKfpN1Afpj1/ZhFcH6LYZOWSBBOAuUNjPLxMNSYOOuITuuYWo=\")","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1agdxuk" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">BinData</span>(<span class="lg-highlight-number">6</span>,<span class="lg-highlight-string">"AmTi2H3xaEk8u9+jlFNaLLkC3Q/+kmwDbbWrq+h9nuv9W+u7A5a0UnpULBNZH+Q21fAztPpU09wpKPrju9dKfpN1Afpj1/ZhFcH6LYZOWSBBOAuUNjPLxMNSYOOuITuuYWo="</span>)</td></tr></tbody></table></code></pre> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For complete documentation on initiating MongoDB connections with client-side field level encryption enabled, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-set-qe-algorithm"> </span> </section> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Queryable Encryption <a class="headerlink leafygreen-ui-1kepx47" href="#queryable-encryption" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="queryable-encryption"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example uses a locally managed KMS for the Queryable Encryption configuration. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Start mongoshStart the mongosh client.Generate Your KeyTo configure Queryable Encryption for a locally managed key,\ngenerate a base64-encoded 96-byte string with no line breaks.Create the Queryable Encryption OptionsCreate the Queryable Encryption options using the generated local key string:Create Your Encrypted ClientUse the Mongo() constructor with the queryable\nencryption options configured to create a database connection. Replace\nthe mongodb://myMongo.example.net URI with the connection\nstring URI of the target cluster.","name":"Create Your Encrypted Connection"},{"@type":"HowToStep","text":"Retrieve the ClientEncryption object\nand use the ClientEncryption.encrypt() method to encrypt\na value using a specific data encryption key UUID and\nencryption algorithm:You can also specify the algorithm using a document containing the\nfields:algorithmqueryTypecontentionFactor","name":"Encrypt Your Data"}],"name":"Queryable Encryption","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Create Your Encrypted Connection <a class="headerlink leafygreen-ui-1kepx47" href="#create-your-encrypted-connection-1" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-your-encrypted-connection-1"> </div> </a> </h4> <ol class="leafygreen-ui-rioki0" type="a"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Start mongosh </p> <p class="leafygreen-ui-1kp3ins"> Start the <code class="leafygreen-ui-1l06pbn"> mongosh </code> client. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh --nodb","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh --nodb</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Generate Your Key </p> <p class="leafygreen-ui-1kp3ins"> To configure Queryable Encryption for a locally managed key, generate a base64-encoded 96-byte string with no line breaks. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"const TEST_LOCAL_KEY = require(\"crypto\").randomBytes(96).toString(\"base64\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> <span class="lg-highlight-variable lg-highlight-constant">TEST_LOCAL_KEY</span> <!-- -->= <span class="lg-highlight-built_in">require</span>(<span class="lg-highlight-string">"crypto"</span>).<span class="lg-highlight-title lg-highlight-function">randomBytes</span>(<span class="lg-highlight-number">96</span>).<span class="lg-highlight-title lg-highlight-function">toString</span>(<span class="lg-highlight-string">"base64"</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create the Queryable Encryption Options </p> <p class="leafygreen-ui-1kp3ins"> Create the Queryable Encryption options using the generated local key string: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":" var autoEncryptionOpts = {\n \"keyVaultNamespace\" : \"encryption.__dataKeys\",\n \"kmsProviders\" : {\n \"local\" : {\n \"key\" : BinData(0, TEST_LOCAL_KEY)\n }\n }\n }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-keyword">var</span> autoEncryptionOpts <!-- -->= <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"keyVaultNamespace"</span> <!-- -->: <span class="lg-highlight-string">"encryption.__dataKeys"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"kmsProviders"</span> <!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"local"</span> <!-- -->: <!-- -->{</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"key"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">BinData</span>(<span class="lg-highlight-number">0</span>, <span class="lg-highlight-variable lg-highlight-constant">TEST_LOCAL_KEY</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Create Your Encrypted Client </p> <p class="leafygreen-ui-1kp3ins"> Use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> </a> constructor with the queryable encryption options configured to create a database connection. Replace the <code class="leafygreen-ui-1l06pbn"> mongodb://myMongo.example.net </code> URI with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string/#std-label-mongodb-uri"> connection string URI </a> of the target cluster. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"encryptedClient = Mongo(\n \"mongodb://myMongo.example.net:27017/?replSetName=myMongo\",\n autoEncryptionOpts\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">encryptedClient <!-- -->= <span class="lg-highlight-title lg-highlight-class">Mongo</span>(</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"mongodb://myMongo.example.net:27017/?replSetName=myMongo"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->autoEncryptionOpts</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Encrypt Your Data <a class="headerlink leafygreen-ui-1kepx47" href="#encrypt-your-data-1" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="encrypt-your-data-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Retrieve the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/getClientEncryption/#mongodb-method-getClientEncryption"> <code class="leafygreen-ui-1l06pbn"> ClientEncryption </code> </a> object and use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-ClientEncryption.encrypt" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> ClientEncryption.encrypt() </code> </span> </a> method to encrypt a value using a specific data encryption key <code class="leafygreen-ui-1l06pbn"> UUID </code> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/csfle/fundamentals/encryption-algorithms/#std-label-field-level-encryption-algorithms"> encryption algorithm <!-- --> : </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"const eDB = \"encrypted\"\nconst eKV = \"__keyVault\"\n\nconst clientEncryption = encryptedClient.getClientEncryption();\nconst keyVaultClient = Mongo().getDB(eDB).getCollection(eKV)\n\nconst dek = keyVaultClient.findOne({ keyAltNames: \"dataKey1\" })\n\nclientEncryption.encrypt(\n dek._id,\n \"123-45-6789\",\n \"Unindexed\"\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> eDB <!-- -->= <span class="lg-highlight-string">"encrypted"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> eKV <!-- -->= <span class="lg-highlight-string">"__keyVault"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> clientEncryption <!-- -->= <!-- -->encryptedClient.<span class="lg-highlight-title lg-highlight-function">getClientEncryption</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> keyVaultClient <!-- -->= <span class="lg-highlight-title lg-highlight-class">Mongo</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">getDB</span>(<!-- -->eDB).<span class="lg-highlight-title lg-highlight-function">getCollection</span>(<!-- -->eKV)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> dek <!-- -->= <!-- -->keyVaultClient.<span class="lg-highlight-title lg-highlight-function">findOne</span>(<!-- -->{ <span class="lg-highlight-attr">keyAltNames</span>: <span class="lg-highlight-string">"dataKey1"</span> })</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">clientEncryption.<span class="lg-highlight-title lg-highlight-function">encrypt</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->dek.<span class="lg-highlight-property">_id</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"123-45-6789"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"Unindexed"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> You can also specify the algorithm using a document containing the fields: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> algorithm </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> queryType </code> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> contentionFactor </code> </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"const eDB = \"encrypted\"\nconst eKV = \"__keyVault\"\n\nconst clientEncryption = encryptedClient.getClientEncryption();\nconst keyVaultClient = Mongo().getDB(eDB).getCollection(eKV)\n\nconst dek = keyVaultClient.findOne({ keyAltNames: \"dataKey1\" })\n\nclientEncryption.encrypt(\n dek._id,\n \"123-45-6789\",\n {\n algorithm: \"Indexed\",\n queryType: \"equality\",\n contentionFactor: 4\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> eDB <!-- -->= <span class="lg-highlight-string">"encrypted"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> eKV <!-- -->= <span class="lg-highlight-string">"__keyVault"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> clientEncryption <!-- -->= <!-- -->encryptedClient.<span class="lg-highlight-title lg-highlight-function">getClientEncryption</span>(<!-- -->)<!-- -->;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> keyVaultClient <!-- -->= <span class="lg-highlight-title lg-highlight-class">Mongo</span>(<!-- -->).<span class="lg-highlight-title lg-highlight-function">getDB</span>(<!-- -->eDB).<span class="lg-highlight-title lg-highlight-function">getCollection</span>(<!-- -->eKV)</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-keyword">const</span> dek <!-- -->= <!-- -->keyVaultClient.<span class="lg-highlight-title lg-highlight-function">findOne</span>(<!-- -->{ <span class="lg-highlight-attr">keyAltNames</span>: <span class="lg-highlight-string">"dataKey1"</span> })</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><div class="leafygreen-ui-ihxujy"></div></td></tr><tr class=""><td class="leafygreen-ui-7razhx">clientEncryption.<span class="lg-highlight-title lg-highlight-function">encrypt</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->dek.<span class="lg-highlight-property">_id</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"123-45-6789"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">algorithm</span>: <span class="lg-highlight-string">"Indexed"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">queryType</span>: <span class="lg-highlight-string">"equality"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">contentionFactor</span>: <span class="lg-highlight-number">4</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> </div> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Example Results <a class="headerlink leafygreen-ui-1kepx47" href="#example-results-1" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example-results-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> If successful, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-ClientEncryption.encrypt" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> encrypt() </code> </span> </a> returns the encrypted value: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"Binary(Buffer.from(\"05b100000005640020000000005ab3581a43e39a8e855b1ac87013e841735c09d19ae86535eea718dd56122ba50573002000000000703d2cba9832d90436c6c92eb232aa5b968cdcd7a3138570bc87ef0a9eb3a0e905630020000000009cb61df010b1bb54670a5ad979f25f4c48889059dfd8920782cf03dd27d1a50b05650020000000003f5acea703ea357d3eea4c6a5b19139a580089341424a247839fd4d5cf0d312a12636d00040000000000000000\", \"hex\"), 6)","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-tyg50d"> <pre class="leafygreen-ui-1agdxuk" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-title lg-highlight-class">Binary</span>(<span class="lg-highlight-title lg-highlight-class">Buffer</span>.<span class="lg-highlight-title lg-highlight-function">from</span>(<span class="lg-highlight-string">"05b100000005640020000000005ab3581a43e39a8e855b1ac87013e841735c09d19ae86535eea718dd56122ba50573002000000000703d2cba9832d90436c6c92eb232aa5b968cdcd7a3138570bc87ef0a9eb3a0e905630020000000009cb61df010b1bb54670a5ad979f25f4c48889059dfd8920782cf03dd27d1a50b05650020000000003f5acea703ea357d3eea4c6a5b19139a580089341424a247839fd4d5cf0d312a12636d00040000000000000000"</span>, <span class="lg-highlight-string">"hex"</span>)<!-- -->, <span class="lg-highlight-number">6</span>)</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> For complete documentation on initiating MongoDB connections with client-side field level encryption enabled, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/Mongo/#mongodb-method-Mongo"> <code class="leafygreen-ui-1l06pbn"> Mongo() </code> . </a> </p> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/db.resetError/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.resetError() <a class="headerlink leafygreen-ui-1kepx47" href="#db.reseterror--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="db.reseterror--"> </div> </a> </h1> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.resetError() </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.resetError" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-db.resetError"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> <em> Removed in MongoDB 5.0. </em> </p> <p class="leafygreen-ui-1kp3ins"> Provides a wrapper around the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/resetError/#mongodb-dbcommand-dbcmd.resetError"> <code class="leafygreen-ui-1l06pbn"> resetError </code> </a> command ( <em> also removed in MongoDB 5.0 </em> ). </p> </dd> </dl> </section>
https://www.mongodb.com/docs/manual/reference/operator/update/position/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $position <a class="headerlink leafygreen-ui-1kepx47" href="#-position" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-position"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="update"> <dt> <code class="leafygreen-ui-1l06pbn"> $position </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-update-up.-position" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-update-up.-position"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-position" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $position </code> </span> </a> modifier specifies the location in the array at which the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#mongodb-update-up.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> operator inserts elements. Without the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-position" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $position </code> </span> </a> modifier, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#mongodb-update-up.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> operator inserts elements to the end of the array. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#std-label-push-modifiers"> $push modifiers </a> for more information. </p> <p class="leafygreen-ui-1kp3ins"> To use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-position" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $position </code> </span> </a> modifier, it <strong> must </strong> appear with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/each/#mongodb-update-up.-each"> <code class="leafygreen-ui-1l06pbn"> $each </code> </a> modifier. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n $push: {\n &lt;field&gt;: {\n $each: [ &lt;value1&gt;, &lt;value2&gt;, ... ],\n $position: &lt;num&gt;\n }\n }\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$push</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> &lt;<!-- -->field<!-- -->&gt;<!-- -->: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$each</span>: <!-- -->[ &lt;<!-- -->value1<!-- -->&gt;<!-- -->,<!-- --> <!-- -->&lt;<!-- -->value2<!-- -->&gt;<!-- -->,<!-- --> <!-- -->...<!-- --> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$position</span>: &lt;<!-- -->num<!-- -->&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->}</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> &lt;num&gt; </code> indicates the position in the array, based on a zero-based array index (position): </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A non-negative number corresponds to the position in the array, starting from the beginning of the array. If the value of <code class="leafygreen-ui-1l06pbn"> &lt;num&gt; </code> is greater or equal to the length of the array, the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-position" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $position </code> </span> </a> modifier has no effect and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#mongodb-update-up.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> adds elements to the end of the array. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A negative number corresponds to the position in the array, counting from (but not including) the last element of the array. For example, <code class="leafygreen-ui-1l06pbn"> -1 </code> indicates the position just before the last element in the array. If you specify multiple elements in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/each/#mongodb-update-up.-each"> <code class="leafygreen-ui-1l06pbn"> $each </code> </a> array, the last added element is in the specified position from the end. If the absolute value of <code class="leafygreen-ui-1l06pbn"> &lt;num&gt; </code> is greater than or equal to the length of the array, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/push/#mongodb-update-up.-push"> <code class="leafygreen-ui-1l06pbn"> $push </code> </a> adds elements to the beginning of the array. </p> </li> </ul> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, update operators process document fields with string-based names in lexicographic order. Fields with numeric names are processed in numeric order. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/#std-label-update-operators-processing-order"> Update Operators Behavior </a> for details. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Add Elements at the Start of the Array <a class="headerlink leafygreen-ui-1kepx47" href="#add-elements-at-the-start-of-the-array" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="add-elements-at-the-start-of-the-array"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Create the <code class="leafygreen-ui-1l06pbn"> students </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.insertOne( { \"_id\" : 1, \"scores\" : [ 100 ] } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>( <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"scores"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">100</span> ] } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation updates the <code class="leafygreen-ui-1l06pbn"> scores </code> field to add the elements <code class="leafygreen-ui-1l06pbn"> 50 </code> , <code class="leafygreen-ui-1l06pbn"> 60 </code> and <code class="leafygreen-ui-1l06pbn"> 70 </code> to the beginning of the array: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.updateOne(\n { _id: 1 },\n {\n $push: {\n scores: {\n $each: [ 50, 60, 70 ],\n $position: 0\n }\n }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$push</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">scores</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$each</span>: <!-- -->[ <span class="lg-highlight-number">50</span>, <span class="lg-highlight-number">60</span>, <span class="lg-highlight-number">70</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$position</span>: <span class="lg-highlight-number">0</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation results in the following updated document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"scores\" : [ 50, 60, 70, 100 ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"scores"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">50</span>, <span class="lg-highlight-number">60</span>, <span class="lg-highlight-number">70</span>, <span class="lg-highlight-number">100</span> ] }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Add Elements to the Middle of the Array <a class="headerlink leafygreen-ui-1kepx47" href="#add-elements-to-the-middle-of-the-array" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="add-elements-to-the-middle-of-the-array"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Add a document to the <code class="leafygreen-ui-1l06pbn"> students </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.insertOne( { \"_id\" : 2, \"scores\" : [ 50, 60, 70, 100 ] } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>( <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"scores"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">50</span>, <span class="lg-highlight-number">60</span>, <span class="lg-highlight-number">70</span>, <span class="lg-highlight-number">100</span> ] } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation updates the <code class="leafygreen-ui-1l06pbn"> scores </code> field to add the elements <code class="leafygreen-ui-1l06pbn"> 20 </code> and <code class="leafygreen-ui-1l06pbn"> 30 </code> at the array index (position) of <code class="leafygreen-ui-1l06pbn"> 2 </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.updateOne(\n { _id: 2 },\n {\n $push: {\n scores: {\n $each: [ 20, 30 ],\n $position: 2\n }\n }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$push</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">scores</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$each</span>: <!-- -->[ <span class="lg-highlight-number">20</span>, <span class="lg-highlight-number">30</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$position</span>: <span class="lg-highlight-number">2</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation results in the following updated document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 2, \"scores\" : [ 50, 60, 20, 30, 70, 100 ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"scores"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">50</span>, <span class="lg-highlight-number">60</span>, <span class="lg-highlight-number">20</span>, <span class="lg-highlight-number">30</span>, <span class="lg-highlight-number">70</span>, <span class="lg-highlight-number">100</span> ] }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use a Negative Array Index (Position) to Add Elements to the Array <a class="headerlink leafygreen-ui-1kepx47" href="#use-a-negative-array-index--position--to-add-elements-to-the-array" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-a-negative-array-index--position--to-add-elements-to-the-array"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-position" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $position </code> </span> </a> can accept a negative array index (position) value to indicate the position starting from the end, counting from (but not including) the last element of the array. For example, <code class="leafygreen-ui-1l06pbn"> -1 </code> indicates the position just before the last element in the array. </p> <p class="leafygreen-ui-1kp3ins"> Add the following document to the <code class="leafygreen-ui-1l06pbn"> students </code> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.insertOne(\n { \"_id\" : 3, \"scores\" : [ 50, 60, 20, 30, 70, 100 ] }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"scores"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">50</span>, <span class="lg-highlight-number">60</span>, <span class="lg-highlight-number">20</span>, <span class="lg-highlight-number">30</span>, <span class="lg-highlight-number">70</span>, <span class="lg-highlight-number">100</span> ] }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation specifies <code class="leafygreen-ui-1l06pbn"> -2 </code> for the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-update-up.-position" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $position </code> </span> </a> to add <code class="leafygreen-ui-1l06pbn"> 90 </code> at the position two places before the last element, and then <code class="leafygreen-ui-1l06pbn"> 80 </code> at the position two places before the last element. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> With a negative array index (position), if you specify multiple elements in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/update/each/#mongodb-update-up.-each"> <code class="leafygreen-ui-1l06pbn"> $each </code> </a> array, the last added element is in the specified position from the end. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.students.updateOne(\n { _id: 3 },\n {\n $push: {\n scores: {\n $each: [ 90, 80 ],\n $position: -2\n }\n }\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">students</span>.<span class="lg-highlight-title lg-highlight-function">updateOne</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$push</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">scores</span>: <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$each</span>: <!-- -->[ <span class="lg-highlight-number">90</span>, <span class="lg-highlight-number">80</span> ]<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">$position</span>: <!-- -->-<span class="lg-highlight-number">2</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation results in the following updated document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 3, \"scores\" : [ 50, 60, 20, 30, 90, 80, 70, 100 ] }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"scores"</span> <!-- -->: <!-- -->[ <span class="lg-highlight-number">50</span>, <span class="lg-highlight-number">60</span>, <span class="lg-highlight-number">20</span>, <span class="lg-highlight-number">30</span>, <span class="lg-highlight-number">90</span>, <span class="lg-highlight-number">80</span>, <span class="lg-highlight-number">70</span>, <span class="lg-highlight-number">100</span> ] }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/deploy-sharded-cluster-with-keyfile-access-control/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Deploy Self-Managed Sharded Cluster with Keyfile Authentication <a class="headerlink leafygreen-ui-1kepx47" href="#deploy-self-managed-sharded-cluster-with-keyfile-authentication" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="deploy-self-managed-sharded-cluster-with-keyfile-authentication"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#overview" target="_self"> <span> Overview </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#considerations" target="_self"> <span> Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#before-you-begin" target="_self"> <span> Before You Begin </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#deploy-sharded-cluster-with-keyfile-access-control" target="_self"> <span> Deploy Sharded Cluster with Keyfile Access Control </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#next-steps" target="_self"> <span> Next Steps </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#x.509-internal-authentication" target="_self"> <span> x.509 Internal Authentication </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Overview <a class="headerlink leafygreen-ui-1kepx47" href="#overview" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="overview"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Enforcing access control on a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-sharded-cluster"> sharded cluster </a> requires configuring: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Security between components of the cluster using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-replica-set-security"> Internal Authentication <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Security between connecting clients and the cluster using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/#std-label-authorization"> User Access Controls <!-- --> . </a> </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For this tutorial, each member of the sharded cluster <em> must </em> use the same internal authentication mechanism and settings. This means enforcing internal authentication on each <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> in the cluster. </p> <p class="leafygreen-ui-1kp3ins"> The following tutorial uses a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-internal-auth-keyfile"> keyfile </a> to enable internal authentication. </p> <p class="leafygreen-ui-1kp3ins"> Enforcing internal authentication also enforces user access control. To connect to the replica set, clients like <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> need to use a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/#std-label-authorization"> user account </a> . See <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-security-shardClust-deploy-access-control" target="_self"> <span> Access Control <!-- --> . </span> </a> </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> CloudManager and OpsManager <a class="headerlink leafygreen-ui-1kepx47" href="#cloudmanager-and-opsmanager" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="cloudmanager-and-opsmanager"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you are using Cloud Manager or Ops Manager to manage your deployment, see the respective <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/cloud-manager/tutorial/edit-host-authentication-credentials/" target="_self"> <span> Cloud Manager manual </span> </a> or the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/ops-manager/current/tutorial/edit-host-authentication-credentials/" target="_self"> <span> Ops Manager manual </span> </a> to enforce authentication. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#considerations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="considerations"> </div> </a> </h2> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To avoid configuration updates due to IP address changes, use DNS hostnames instead of IP addresses. It is particularly important to use a DNS hostname instead of an IP address when configuring replica set members or sharded cluster members. </p> <p class="leafygreen-ui-1kp3ins"> Use hostnames instead of IP addresses to configure clusters across a split network horizon. Starting in MongoDB 5.0, nodes that are only configured with an IP address fail startup validation and do not start. </p> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> IP Binding <a class="headerlink leafygreen-ui-1kepx47" href="#ip-binding" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="ip-binding"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB binaries, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , bind to <code class="leafygreen-ui-1l06pbn"> localhost </code> by default. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Keyfile Security <a class="headerlink leafygreen-ui-1kepx47" href="#keyfile-security" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="keyfile-security"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Keyfiles are bare-minimum forms of security and are best suited for testing or development environments. For production environments we recommend using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-x.509/#std-label-security-auth-x509"> x.509 certificates <!-- --> . </a> </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-security-shardClust-deploy-access-control"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Access Control <a class="headerlink leafygreen-ui-1kepx47" href="#access-control" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="access-control"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> This tutorial covers creating the minimum number of administrative users on the <code class="leafygreen-ui-1l06pbn"> admin </code> database <em> only </em> . For the user authentication, the tutorial uses the default <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-scram/#std-label-authentication-scram"> SCRAM </a> authentication mechanism. Challenge-response security mechanisms are best suited for testing or development environments. For production environments, we recommend using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-x.509/#std-label-security-auth-x509"> x.509 certificates </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-ldap/#std-label-security-ldap"> Self-Managed LDAP Proxy Authentication </a> (available for MongoDB Enterprise only) or <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/kerberos/#std-label-security-kerberos"> Kerberos Authentication on Self-Managed Deployments </a> (available for MongoDB Enterprise only). </p> <p class="leafygreen-ui-1kp3ins"> For details on creating users for specific authentication mechanism, refer to the specific authentication mechanism pages. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/security-checklist/#std-label-security-checklist-role-based-access-control"> ➤ <!-- --> Configure Role-Based Access Control </a> for best practices for user creation and management. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Users <a class="headerlink leafygreen-ui-1kepx47" href="#users" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="users"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> In general, to create users for a sharded clusters, connect to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> and add the sharded cluster users. </p> <p class="leafygreen-ui-1kp3ins"> However, some maintenance operations require direct connections to specific shards in a sharded cluster. To perform these operations, you must connect directly to the shard and authenticate as a shard-local administrative user. </p> <p class="leafygreen-ui-1kp3ins"> Shard-local users exist only in the specific shard and should only be used for shard-specific maintenance and configuration. You cannot connect to the <code class="leafygreen-ui-1l06pbn"> mongos </code> with shard-local users. </p> <p class="leafygreen-ui-1kp3ins"> This tutorial requires creating sharded cluster users, but includes optional steps for adding shard-local users. </p> <p class="leafygreen-ui-1kp3ins"> See the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-users/"> Users in Self-Managed Deployments </a> security documentation for more information. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Operating System <a class="headerlink leafygreen-ui-1kepx47" href="#operating-system" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="operating-system"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> This tutorial uses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> programs. Windows users should use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod.exe/#mongodb-binary-bin.mongod.exe"> <code class="leafygreen-ui-1l06pbn"> mongod.exe </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos.exe/#mongodb-binary-bin.mongos.exe"> <code class="leafygreen-ui-1l06pbn"> mongos.exe </code> </a> programs instead. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Before You Begin <a class="headerlink leafygreen-ui-1kepx47" href="#before-you-begin" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="before-you-begin"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, you can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-directShardOperations"> <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> </a> role to perform maintenance operations that require you to execute commands directly against a shard. </p> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Running commands using the <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> role can cause your cluster to stop working correctly and may cause data corruption. Only use the <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> role for maintenance purposes or under the guidance of MongoDB support. Once you are done performing maintenance operations, stop using the <code class="leafygreen-ui-1l06pbn"> directShardOperations </code> role. </p> </div> </div> <span class="leafygreen-ui-1qnjd6d" id="std-label-security-shard-deploy-sharded-cluster-with-access-control"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Deploy Sharded Cluster with Keyfile Access Control <a class="headerlink leafygreen-ui-1kepx47" href="#deploy-sharded-cluster-with-keyfile-access-control" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="deploy-sharded-cluster-with-keyfile-access-control"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following procedures involve creating a new sharded cluster that consists of a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> , the config servers, and two shards. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> To avoid configuration updates due to IP address changes, use DNS hostnames instead of IP addresses. It is particularly important to use a DNS hostname instead of an IP address when configuring replica set members or sharded cluster members. </p> <p class="leafygreen-ui-1kp3ins"> Use hostnames instead of IP addresses to configure clusters across a split network horizon. Starting in MongoDB 5.0, nodes that are only configured with an IP address fail startup validation and do not start. </p> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create the Keyfile <a class="headerlink leafygreen-ui-1kepx47" href="#create-the-keyfile" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-the-keyfile"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> With <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-internal-auth-keyfile"> keyfile </a> authentication, each <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances in the sharded cluster uses the contents of the keyfile as the shared password for authenticating other members in the deployment. Only <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances with the correct keyfile can join the sharded cluster. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-internal-auth-keyfile"> Keyfiles for internal membership authentication </a> use YAML format to allow for multiple keys in a keyfile. The YAML format accepts either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A single key string (same as in earlier versions) </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A sequence of key strings </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The YAML format is compatible with the existing single-key keyfiles that use the text file format. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> A key's length must be between 6 and 1024 characters and may only contain characters in the base64 set. All members of the sharded cluster must share at least one common key. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> On UNIX systems, the keyfile must not have group or world permissions. On Windows systems, keyfile permissions are not checked. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> You can generate a keyfile using any method you choose. For example, the following operation uses <code class="leafygreen-ui-1l06pbn"> openssl </code> to generate a complex pseudo-random 1024 character string to use as a shared password. It then uses <code class="leafygreen-ui-1l06pbn"> chmod </code> to change file permissions to provide read permissions for the file owner only: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"openssl rand -base64 756 &gt; &lt;path-to-keyfile&gt;\nchmod 400 &lt;path-to-keyfile&gt;","programmingLanguage":"Bash"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">openssl rand -<span class="lg-highlight-built_in">base64</span> 756 &gt; &lt;path-to-keyfile&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-built_in">chmod</span> 400 &lt;path-to-keyfile&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/#std-label-internal-auth-keyfile"> Keyfiles </a> for additional details and requirements for using keyfiles. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Distribute the Keyfile <a class="headerlink leafygreen-ui-1kepx47" href="#distribute-the-keyfile" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="distribute-the-keyfile"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Copy the keyfile to each server hosting the sharded cluster members. Ensure that the user running the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances is the owner of the file and can access the keyfile. </p> <p class="leafygreen-ui-1kp3ins"> Avoid storing the keyfile on storage mediums that can be easily disconnected from the hardware hosting the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances, such as a USB drive or a network attached storage device. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-deploy-auth-cluster-create-config-server-replica-set"> </span> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create the Config Server Replica Set <a class="headerlink leafygreen-ui-1kepx47" href="#create-the-config-server-replica-set" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-the-config-server-replica-set"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following steps deploys a config server replica set. </p> <p class="leafygreen-ui-1kp3ins"> For a production deployment, deploys a config server replica set with at least three members. For testing purposes, you can create a single-member replica set. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Start each mongod in the config server replica set.\nInclude the keyFile setting. The keyFile setting\nenforces both Self-Managed Internal/Membership Authentication and\nRole-Based Access Control in Self-Managed Deployments.You can specify the mongod settings either via a\nconfiguration file or the command line.Configuration FileIf using a configuration file, set security.keyFile to the\nkeyfile's path, sharding.clusterRole to configsvr,\nand replication.replSetName to the desired name of the\nconfig server replica set.Include additional options as required\nfor your configuration. For instance, if you wish remote clients to\nconnect to your deployment or your deployment members are run on\ndifferent hosts, specify the net.bindIp setting.Start the mongod specifying the --config option and the\npath to the configuration file.Command LineIf using the command line parameters, start the mongod with\nthe --keyFile, --configsvr, and --replSet parameters.Include additional options as required for your configuration. For\ninstance, if you wish remote clients to connect to your deployment\nor your deployment members are run on different hosts, specify the\n--bind_ip."},{"@type":"HowToStep","text":"Connect to a member of the replica set over the localhost interface.Connect mongosh to one of the\nmongod instances over the localhost\ninterface. You must run mongosh\non the same physical machine as the mongod instance.The localhost interface is only available\nsince no users have been created for the deployment. The\nlocalhost interface closes after the\ncreation of the first user."},{"@type":"HowToStep","text":"The rs.initiate() method initiates the replica set and can\ntake an optional replica set configuration document. In the replica set\nconfiguration document, include:The _id. The _id must match the --replSet\nparameter passed to the mongod.The members field. The members field is an\narray and requires a document per each member of the replica set.The configsvr field. The configsvr field must\nbe set to true for the config server replica set.See Self-Managed Replica Set Configuration for more information on\nreplica set configuration documents.Initiate the replica set using the rs.initiate() method\nand a configuration document:"}],"name":"Create the Config Server Replica Set","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <p class="leafygreen-ui-1kp3ins"> Start <em> each </em> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> in the config server replica set. Include the <code class="leafygreen-ui-1l06pbn"> keyFile </code> setting. The <code class="leafygreen-ui-1l06pbn"> keyFile </code> setting enforces both <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/"> Self-Managed Internal/Membership Authentication </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/"> Role-Based Access Control in Self-Managed Deployments <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> You can specify the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> settings either via a configuration file or the command line. </p> <p class="leafygreen-ui-1kp3ins"> <strong> Configuration File </strong> </p> <p class="leafygreen-ui-1kp3ins"> If using a configuration file, set <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.keyFile"> <code class="leafygreen-ui-1l06pbn"> security.keyFile </code> </a> to the keyfile's path, <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-sharding.clusterRole"> <code class="leafygreen-ui-1l06pbn"> sharding.clusterRole </code> </a> to <code class="leafygreen-ui-1l06pbn"> configsvr </code> , and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> </a> to the desired name of the config server replica set. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"security:\n keyFile: &lt;path-to-keyfile&gt;\nsharding:\n clusterRole: configsvr\nreplication:\n replSetName: &lt;setname&gt;\n","programmingLanguage":"YAML"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light yaml leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">security:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">keyFile:</span> <span class="lg-highlight-string">&lt;path-to-keyfile&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">sharding:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">clusterRole:</span> <span class="lg-highlight-string">configsvr</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">replication:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">replSetName:</span> <span class="lg-highlight-string">&lt;setname&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> setting. </p> <p class="leafygreen-ui-1kp3ins"> Start the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> specifying the <code class="leafygreen-ui-1l06pbn"> --config </code> option and the path to the configuration file. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --config &lt;path-to-config-file&gt;\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --config &lt;path-to-config-file&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> <strong> Command Line </strong> </p> <p class="leafygreen-ui-1kp3ins"> If using the command line parameters, start the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> with the <code class="leafygreen-ui-1l06pbn"> --keyFile </code> , <code class="leafygreen-ui-1l06pbn"> --configsvr </code> , and <code class="leafygreen-ui-1l06pbn"> --replSet </code> parameters. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --keyFile &lt;path-to-keyfile&gt; --configsvr --replSet &lt;setname&gt; --dbpath &lt;path&gt;\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --keyFile &lt;path-to-keyfile&gt; --configsvr --replSet &lt;setname&gt; --dbpath &lt;path&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> . </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Connect to a member of the replica set over the localhost interface. <a class="headerlink leafygreen-ui-1kepx47" href="#connect-to-a-member-of-the-replica-set-over-the-localhost-interface" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="connect-to-a-member-of-the-replica-set-over-the-localhost-interface"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Connect <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to one of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances over the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost interface </a> . You must run <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> on the same physical machine as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost interface </a> is only available since no users have been created for the deployment. The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost interface </a> closes after the creation of the first user. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.initiate/#mongodb-method-rs.initiate"> <code class="leafygreen-ui-1l06pbn"> rs.initiate() </code> </a> method initiates the replica set and can take an optional <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/"> replica set configuration document </a> . In the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/"> replica set configuration document </a> , include: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf._id"> <code class="leafygreen-ui-1l06pbn"> _id </code> </a> . The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf._id"> <code class="leafygreen-ui-1l06pbn"> _id </code> </a> <em> must </em> match the <code class="leafygreen-ui-1l06pbn"> --replSet </code> parameter passed to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members"> <code class="leafygreen-ui-1l06pbn"> members </code> </a> field. The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members"> <code class="leafygreen-ui-1l06pbn"> members </code> </a> field is an array and requires a document per each member of the replica set. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.configsvr"> <code class="leafygreen-ui-1l06pbn"> configsvr </code> </a> field. The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.configsvr"> <code class="leafygreen-ui-1l06pbn"> configsvr </code> </a> field must be set to <code class="leafygreen-ui-1l06pbn"> true </code> for the config server replica set. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/"> Self-Managed Replica Set Configuration </a> for more information on replica set configuration documents. </p> <p class="leafygreen-ui-1kp3ins"> Initiate the replica set using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.initiate/#mongodb-method-rs.initiate"> <code class="leafygreen-ui-1l06pbn"> rs.initiate() </code> </a> method and a configuration document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"rs.initiate(\n {\n _id: \"myReplSet\",\n configsvr: true,\n members: [\n { _id : 0, host : \"cfg1.example.net:27019\" },\n { _id : 1, host : \"cfg2.example.net:27019\" },\n { _id : 2, host : \"cfg3.example.net:27019\" }\n ]\n }\n)\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">initiate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-string">"myReplSet"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">configsvr</span>: <span class="lg-highlight-literal">true</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">members</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">0</span>, <!-- -->host <!-- -->: <span class="lg-highlight-string">"cfg1.example.net:27019"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">1</span>, <!-- -->host <!-- -->: <span class="lg-highlight-string">"cfg2.example.net:27019"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">2</span>, <!-- -->host <!-- -->: <span class="lg-highlight-string">"cfg3.example.net:27019"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Once the config server replica set (CSRS) is initiated and up, proceed to creating the shard replica sets. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create the Shard Replica Sets <a class="headerlink leafygreen-ui-1kepx47" href="#create-the-shard-replica-sets" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-the-shard-replica-sets"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> For a production deployment, use a replica set with at least three members. For testing purposes, you can create a single-member replica set. </p> <p class="leafygreen-ui-1kp3ins"> These steps include optional procedures for adding shard-local users. Executing them now ensures that there are users available for each shard to perform shard-level maintenance. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Start each member of the replica set with access control enabled.Running a mongod with the keyFile parameter enforces both\nSelf-Managed Internal/Membership Authentication and\nRole-Based Access Control in Self-Managed Deployments.Start each mongod in the replica set using either\na configuration file or the command line.Configuration FileIf using a configuration file, set the security.keyFile option\nto the keyfile's path, the replication.replSetName to the\ndesired name of the replica set, and the sharding.clusterRole\noption to shardsvr.Include additional options as required\nfor your configuration. For instance, if you wish remote clients to\nconnect to your deployment or your deployment members are run on\ndifferent hosts, specify the net.bindIp setting.Start the mongod specifying the --config option\nand the path to the configuration file.Command LineIf using the command line option, when starting the component, specify\nthe --keyFile, replSet, and --shardsvr parameters, as in the\nfollowing example:Include additional options as required for your configuration. For\ninstance, if you wish remote clients to connect to your deployment\nor your deployment members are run on different hosts, specify the\n--bind_ip."},{"@type":"HowToStep","text":"Connect to a member of the replica set over the localhost interface.Connect mongosh to one of the\nmongod instances over the localhost\ninterface. You must run mongosh\non the same physical machine as the mongod instance.The localhost interface is only available\nsince no users have been created for the deployment. The\nlocalhost interface closes after the\ncreation of the first user."},{"@type":"HowToStep","text":"Initiate the replica set.From mongosh, run the rs.initiate() method.rs.initiate() can take an optional replica set\nconfiguration document. In the\nreplica set configuration document, include:The _id field set to the replica set name specified in\neither the replication.replSetName or the --replSet\noption.The members array with a document per each member of the\nreplica set.The following example initates a three member replica set.rs.initiate() triggers an election and\nelects one of the members to be the primary.Connect to the primary before continuing. Use rs.status() to\nlocate the primary member."},{"@type":"HowToStep","text":"Create the shard-local user administrator (optional).After you create the first user, the localhost exception is no longer available.The first user must have privileges to create other users, such\nas a user with the userAdminAnyDatabase. This ensures\nthat you can create additional users after the Localhost Exception in Self-Managed Deployments\ncloses.If at least one user does not have privileges to create users,\nonce the localhost exception closes you may be unable to create\nor modify users with new privileges, and therefore unable to\naccess necessary operations.Add a user using the db.createUser() method. The user should\nhave at minimum the userAdminAnyDatabase role on the\nadmin database.You must be connected to the primary to create users.The following example creates the user fred with the\nuserAdminAnyDatabase role on the admin database.Passwords should be random, long, and complex to ensure system security\nand to prevent or delay malicious access.You can use the passwordPrompt() method in conjunction with\nvarious user authentication management methods and commands to prompt\nfor the password instead of specifying the password directly in the\nmethod or command call. However, you can still specify the password\ndirectly as you would with earlier versions of the\nmongo shell.Enter the password when prompted.\nSee Database User Roles for a full list of built-in roles\nrelated to database administration operations."},{"@type":"HowToStep","text":"Authenticate as the shard-local user administrator (optional).Authenticate to the admin database.In mongosh, use db.auth() to\nauthenticate. For example, the following authenticate as the user\nadministrator fred:You can use the passwordPrompt() method in conjunction with\nvarious user authentication management methods and commands to prompt\nfor the password instead of specifying the password directly in the\nmethod or command call. However, you can still specify the password\ndirectly as you would with earlier versions of the\nmongo shell.Alternatively, connect a new mongosh instance to\nthe primary replica set member using the -u <username>,\n-p <password>, and the --authenticationDatabase\nparameters.If you do not specify the password to the -p\ncommand-line option, mongosh prompts for the\npassword."},{"@type":"HowToStep","text":"Create the shard-local cluster administrator (optional).The shard-local cluster administrator user has the\nclusterAdmin role, which provides privileges that allow\naccess to replication operations.For a full list of roles related to replica set operations see\nCluster Administration Roles.Create a cluster administrator user and assign the\nclusterAdmin role in the admin database:You can use the passwordPrompt() method in conjunction with\nvarious user authentication management methods and commands to prompt\nfor the password instead of specifying the password directly in the\nmethod or command call. However, you can still specify the password\ndirectly as you would with earlier versions of the\nmongo shell.Enter the password when prompted.See Cluster Administration Roles for a full list of built-in roles related to\nreplica set and sharded cluster operations."}],"name":"Create the Shard Replica Sets","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Start each member of the replica set with access control enabled. <a class="headerlink leafygreen-ui-1kepx47" href="#start-each-member-of-the-replica-set-with-access-control-enabled" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="start-each-member-of-the-replica-set-with-access-control-enabled"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Running a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> with the <code class="leafygreen-ui-1l06pbn"> keyFile </code> parameter enforces both <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-internal-authentication/"> Self-Managed Internal/Membership Authentication </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/"> Role-Based Access Control in Self-Managed Deployments <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Start <em> each </em> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> in the replica set using either a configuration file or the command line. </p> <p class="leafygreen-ui-1kp3ins"> <strong> Configuration File </strong> </p> <p class="leafygreen-ui-1kp3ins"> If using a configuration file, set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.keyFile"> <code class="leafygreen-ui-1l06pbn"> security.keyFile </code> </a> option to the keyfile's path, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> </a> to the desired name of the replica set, and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-sharding.clusterRole"> <code class="leafygreen-ui-1l06pbn"> sharding.clusterRole </code> </a> option to <code class="leafygreen-ui-1l06pbn"> shardsvr </code> . </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"security:\n keyFile: &lt;path-to-keyfile&gt;\nsharding:\n clusterRole: shardsvr\nreplication:\n replSetName: &lt;replsetname&gt;\nstorage:\n dbPath: &lt;path&gt;\n","programmingLanguage":"YAML"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light yaml leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">security:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">keyFile:</span> <span class="lg-highlight-string">&lt;path-to-keyfile&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">sharding:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">clusterRole:</span> <span class="lg-highlight-string">shardsvr</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">replication:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">replSetName:</span> <span class="lg-highlight-string">&lt;replSetName&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">storage:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">dbPath:</span> <span class="lg-highlight-string">&lt;path&gt;</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> setting. </p> <p class="leafygreen-ui-1kp3ins"> Start the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> specifying the <code class="leafygreen-ui-1l06pbn"> --config </code> option and the path to the configuration file. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --config &lt;path-to-config-file&gt;\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --config &lt;path-to-config-file&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> <strong> Command Line </strong> </p> <p class="leafygreen-ui-1kp3ins"> If using the command line option, when starting the component, specify the <code class="leafygreen-ui-1l06pbn"> --keyFile </code> , <code class="leafygreen-ui-1l06pbn"> replSet </code> , and <code class="leafygreen-ui-1l06pbn"> --shardsvr </code> parameters, as in the following example: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongod --keyFile &lt;path-to-keyfile&gt; --shardsvr --replSet &lt;replsetname&gt; --dbpath &lt;path&gt;\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongod --keyFile &lt;path-to-keyfile&gt; --shardsvr --replSet &lt;replSetName&gt; --dbpath &lt;path&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> . </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Connect to a member of the replica set over the localhost interface. <a class="headerlink leafygreen-ui-1kepx47" href="#connect-to-a-member-of-the-replica-set-over-the-localhost-interface-1" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="connect-to-a-member-of-the-replica-set-over-the-localhost-interface-1"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Connect <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to one of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instances over the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost interface </a> . You must run <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> on the same physical machine as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> instance. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost interface </a> is only available since no users have been created for the deployment. The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost interface </a> closes after the creation of the first user. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Initiate the replica set. <a class="headerlink leafygreen-ui-1kepx47" href="#initiate-the-replica-set" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="initiate-the-replica-set"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> From <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , run the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.initiate/#mongodb-method-rs.initiate"> <code class="leafygreen-ui-1l06pbn"> rs.initiate() </code> </a> method. </p> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.initiate/#mongodb-method-rs.initiate"> <code class="leafygreen-ui-1l06pbn"> rs.initiate() </code> </a> can take an optional <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/"> replica set configuration document </a> . In the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/"> replica set configuration document </a> , include: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf._id"> <code class="leafygreen-ui-1l06pbn"> _id </code> </a> field set to the replica set name specified in either the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-replication.replSetName"> <code class="leafygreen-ui-1l06pbn"> replication.replSetName </code> </a> or the <code class="leafygreen-ui-1l06pbn"> --replSet </code> option. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.members"> <code class="leafygreen-ui-1l06pbn"> members </code> </a> array with a document per each member of the replica set. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The following example initates a three member replica set. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"rs.initiate(\n {\n _id : \"myReplSet\",\n members: [\n { _id : 0, host : \"s1-mongo1.example.net:27018\" },\n { _id : 1, host : \"s1-mongo2.example.net:27018\" },\n { _id : 2, host : \"s1-mongo3.example.net:27018\" }\n ]\n }\n)\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">rs.<span class="lg-highlight-title lg-highlight-function">initiate</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->_id <!-- -->: <span class="lg-highlight-string">"myReplSet"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">members</span>: <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">0</span>, <!-- -->host <!-- -->: <span class="lg-highlight-string">"s1-mongo1.example.net:27018"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">1</span>, <!-- -->host <!-- -->: <span class="lg-highlight-string">"s1-mongo2.example.net:27018"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->_id <!-- -->: <span class="lg-highlight-number">2</span>, <!-- -->host <!-- -->: <span class="lg-highlight-string">"s1-mongo3.example.net:27018"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.initiate/#mongodb-method-rs.initiate"> <code class="leafygreen-ui-1l06pbn"> rs.initiate() </code> </a> triggers an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-election"> election </a> and elects one of the members to be the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Connect to the primary before continuing. Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> to locate the primary member. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Create the shard-local user administrator (optional). <a class="headerlink leafygreen-ui-1kepx47" href="#create-the-shard-local-user-administrator-optional" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-the-shard-local-user-administrator-optional"> </div> </a> </h4> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> After you create the first user, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost exception </a> is no longer available. </p> <p class="leafygreen-ui-1kp3ins"> The first user must have privileges to create other users, such as a user with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-userAdminAnyDatabase"> <code class="leafygreen-ui-1l06pbn"> userAdminAnyDatabase </code> </a> . This ensures that you can create additional users after the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> Localhost Exception in Self-Managed Deployments </a> closes. </p> <p class="leafygreen-ui-1kp3ins"> If at least one user does <em> not </em> have privileges to create users, once the localhost exception closes you may be unable to create or modify users with new privileges, and therefore unable to access necessary operations. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Add a user using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createUser/#mongodb-method-db.createUser"> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </a> method. The user should have at minimum the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-userAdminAnyDatabase"> <code class="leafygreen-ui-1l06pbn"> userAdminAnyDatabase </code> </a> role on the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </p> <p class="leafygreen-ui-1kp3ins"> You must be connected to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary"> primary </a> to create users. </p> <p class="leafygreen-ui-1kp3ins"> The following example creates the user <code class="leafygreen-ui-1l06pbn"> fred </code> with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-userAdminAnyDatabase"> <code class="leafygreen-ui-1l06pbn"> userAdminAnyDatabase </code> </a> role on the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Passwords should be random, long, and complex to ensure system security and to prevent or delay malicious access. </p> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"admin = db.getSiblingDB(\"admin\")\nadmin.createUser(\n {\n user: \"fred\",\n pwd: passwordPrompt(), // or cleartext password\n roles: [ { role: \"userAdminAnyDatabase\", db: \"admin\" } ]\n }\n)\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">admin <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<span class="lg-highlight-string">"admin"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">admin.<span class="lg-highlight-title lg-highlight-function">createUser</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">user</span>: <span class="lg-highlight-string">"fred"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pwd</span>: <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)<!-- -->, <span class="lg-highlight-comment">// or cleartext password</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"userAdminAnyDatabase"</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"admin"</span> } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Enter the password when prompted. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-database-user-roles"> Database User Roles </a> for a full list of built-in roles related to database administration operations. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Authenticate as the shard-local user administrator (optional). <a class="headerlink leafygreen-ui-1kepx47" href="#authenticate-as-the-shard-local-user-administrator-optional" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="authenticate-as-the-shard-local-user-administrator-optional"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Authenticate to the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </p> <p class="leafygreen-ui-1kp3ins"> In <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.auth/#mongodb-method-db.auth"> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </a> to authenticate. For example, the following authenticate as the user administrator <code class="leafygreen-ui-1l06pbn"> fred </code> : </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.getSiblingDB(\"admin\").auth(\"fred\", passwordPrompt()) // or cleartext password\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<span class="lg-highlight-string">"admin"</span>).<span class="lg-highlight-title lg-highlight-function">auth</span>(<span class="lg-highlight-string">"fred"</span>, <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)) <span class="lg-highlight-comment">// or cleartext password</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Alternatively, connect a new <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> instance to the primary replica set member using the <code class="leafygreen-ui-1l06pbn"> -u &lt;username&gt; </code> , <code class="leafygreen-ui-1l06pbn"> -p &lt;password&gt; </code> , and the <code class="leafygreen-ui-1l06pbn"> --authenticationDatabase </code> parameters. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh -u \"fred\" -p --authenticationDatabase \"admin\"\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh -u "fred" -p --authenticationDatabase "admin"</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If you do not specify the password to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-option-mongosh.--password" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> -p </code> </span> </a> command-line option, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> prompts for the password. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 6 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Create the shard-local cluster administrator (optional). <a class="headerlink leafygreen-ui-1kepx47" href="#create-the-shard-local-cluster-administrator-optional" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-the-shard-local-cluster-administrator-optional"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> The shard-local cluster administrator user has the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-clusterAdmin"> <code class="leafygreen-ui-1l06pbn"> clusterAdmin </code> </a> role, which provides privileges that allow access to replication operations. </p> <p class="leafygreen-ui-1kp3ins"> For a full list of roles related to replica set operations see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-cluster-admin-roles"> Cluster Administration Roles <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Create a cluster administrator user and assign the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-clusterAdmin"> <code class="leafygreen-ui-1l06pbn"> clusterAdmin </code> </a> role in the <code class="leafygreen-ui-1l06pbn"> admin </code> database: </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.getSiblingDB(\"admin\").createUser(\n {\n \"user\" : \"ravi\",\n \"pwd\" : passwordPrompt(), // or cleartext password\n roles: [ { \"role\" : \"clusterAdmin\", \"db\" : \"admin\" } ]\n }\n)\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.getSiblingDB("admin").createUser(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "user" : "ravi",</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "pwd" : passwordPrompt(), // or cleartext password</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> roles: [ { "role" : "clusterAdmin", "db" : "admin" } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Enter the password when prompted. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-cluster-admin-roles"> Cluster Administration Roles </a> for a full list of built-in roles related to replica set and sharded cluster operations. </p> </section> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Connect a <code class="leafygreen-ui-1l06pbn"> mongos </code> to the Sharded Cluster <a class="headerlink leafygreen-ui-1kepx47" href="#connect-a-mongos-to-the-sharded-cluster" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="connect-a-mongos-to-the-sharded-cluster"> </div> </a> </h3> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Connect a mongos to the clusterStart a mongos specifying\nthe keyfile using either a configuration file or a command line parameter.Configuration FileIf using a configuration file, set the\nsecurity.keyFile to the keyfile's path and the\nsharding.configDB to the replica set name and at least\none member of the replica set in <replSetName>/<host:port>\nformat.Include additional options as required\nfor your configuration. For instance, if you wish remote clients to\nconnect to your deployment or your deployment members are run on\ndifferent hosts, specify the net.bindIp setting.Start the mongos specifying the --config option and the\npath to the configuration file.Command LineIf using command line parameters start the mongos and specify\nthe --keyFile and --configdb parameters.Include additional options as required for your configuration. For\ninstance, if you wish remote clients to connect to your deployment\nor your deployment members are run on different hosts, specify the\n--bind_ip."},{"@type":"HowToStep","text":"Connect to a mongos over the localhost interface.Connect mongosh to one of the\nmongos instances over the localhost\ninterface. You must run mongosh\non the same physical machine as the mongos instance.The localhost interface is only available\nsince no users have been created for the deployment. The\nlocalhost interface closes after the\ncreation of the first user."},{"@type":"HowToStep","text":"Create the user administrator.After you create the first user, the localhost exception is no longer available.The first user must have privileges to create other users, such\nas a user with the userAdminAnyDatabase. This ensures\nthat you can create additional users after the Localhost Exception in Self-Managed Deployments\ncloses.If at least one user does not have privileges to create users,\nonce the localhost exception closes you cannot create\nor modify users, and therefore may be unable to\nperform necessary operations.Add a user using the db.createUser() method. The user should\nhave at minimum the userAdminAnyDatabase role on the\nadmin database.Passwords should be random, long, and complex to ensure system security\nand to prevent or delay malicious access.The following example creates the user fred on the\nadmin database:You can use the passwordPrompt() method in conjunction with\nvarious user authentication management methods and commands to prompt\nfor the password instead of specifying the password directly in the\nmethod or command call. However, you can still specify the password\ndirectly as you would with earlier versions of the\nmongo shell.See Database User Roles for a full list of built-in roles and\nrelated to database administration operations."},{"@type":"HowToStep","text":"Authenticate as the user administrator.Use db.auth() to authenticate as the user administrator\nto create additional users:You can use the passwordPrompt() method in conjunction with\nvarious user authentication management methods and commands to prompt\nfor the password instead of specifying the password directly in the\nmethod or command call. However, you can still specify the password\ndirectly as you would with earlier versions of the\nmongo shell.Enter the password when prompted.Alternatively, connect a new mongosh session to the\ntarget replica set member using the -u <username>,\n-p <password>, and the --authenticationDatabase \"admin\"\nparameters. You must use the Localhost Exception in Self-Managed Deployments to connect\nto the mongos.If you do not specify the password to the -p\ncommand-line option, mongosh prompts for the\npassword."},{"@type":"HowToStep","text":"Create Administrative User for Cluster ManagementThe cluster administrator user has the clusterAdmin role,\nwhich grants access to replication and sharding operations.Create a clusterAdmin user in the admin database.The following example creates the user ravi on the admin\ndatabase.Passwords should be random, long, and complex to ensure system\nsecurity and to prevent or delay malicious access.You can use the passwordPrompt() method in conjunction with\nvarious user authentication management methods and commands to prompt\nfor the password instead of specifying the password directly in the\nmethod or command call. However, you can still specify the password\ndirectly as you would with earlier versions of the\nmongo shell.See Cluster Administration Roles for a full list of built-in roles related to\nreplica set and sharded cluster operations."},{"@type":"HowToStep","text":"Create additional users (Optional).Create users to allow clients to connect and access the\nsharded cluster. See Database User Roles for available built-in\nroles, such as read and readWrite.\nYou may also want additional administrative users.\nFor more information on users, see Users in Self-Managed Deployments.To create additional users, you must authenticate as a user with\nuserAdminAnyDatabase or userAdmin roles."}],"name":"Connect a mongos to the Sharded Cluster","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Connect a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> to the cluster <a class="headerlink leafygreen-ui-1kepx47" href="#connect-a-to-the-cluster" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="connect-a-to-the-cluster"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Start a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> specifying the keyfile using either a configuration file or a command line parameter. </p> <p class="leafygreen-ui-1kp3ins"> <strong> Configuration File </strong> </p> <p class="leafygreen-ui-1kp3ins"> If using a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/"> configuration file </a> , set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-security.keyFile"> <code class="leafygreen-ui-1l06pbn"> security.keyFile </code> </a> to the keyfile's path and the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-sharding.configDB"> <code class="leafygreen-ui-1l06pbn"> sharding.configDB </code> </a> to the replica set name and at least one member of the replica set in <code class="leafygreen-ui-1l06pbn"> &lt;replSetName&gt;/&lt;host:port&gt; </code> format. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"security:\n keyFile: &lt;path-to-keyfile&gt;\nsharding:\n configDB: &lt;configreplsetname&gt;/cfg1.example.net:27019,cfg2.example.net:27019,...\n","programmingLanguage":"YAML"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light yaml leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">security:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">keyFile:</span> <span class="lg-highlight-string">&lt;path-to-keyfile&gt;</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"><span class="lg-highlight-attr">sharding:</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">configDB:</span> <span class="lg-highlight-string">&lt;configReplSetName&gt;/cfg1.example.net:27019,cfg2.example.net:27019,...</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/configuration-options/#mongodb-setting-net.bindIp"> <code class="leafygreen-ui-1l06pbn"> net.bindIp </code> </a> setting. </p> <p class="leafygreen-ui-1kp3ins"> Start the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> specifying the <code class="leafygreen-ui-1l06pbn"> --config </code> option and the path to the configuration file. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongos --config &lt;path-to-config&gt;\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongos --config &lt;path-to-config&gt;</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> <strong> Command Line </strong> </p> <p class="leafygreen-ui-1kp3ins"> If using command line parameters start the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> and specify the <code class="leafygreen-ui-1l06pbn"> --keyFile </code> and <code class="leafygreen-ui-1l06pbn"> --configdb </code> parameters. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongos --keyFile &lt;path-to-keyfile&gt; --configdb &lt;configreplsetname&gt;/cfg1.example.net:27019,cfg2.example.net:27019,...\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongos --keyFile &lt;path-to-keyfile&gt; --configdb &lt;configReplSetName&gt;/cfg1.example.net:27019,cfg2.example.net:27019,...</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Include additional options as required for your configuration. For instance, if you wish remote clients to connect to your deployment or your deployment members are run on different hosts, specify the <code class="leafygreen-ui-1l06pbn"> --bind_ip </code> . </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Connect to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> over the localhost interface. <a class="headerlink leafygreen-ui-1kepx47" href="#connect-to-a-over-the-localhost-interface" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="connect-to-a-over-the-localhost-interface"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Connect <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to one of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instances over the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost interface </a> . You must run <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> on the same physical machine as the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance. </p> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost interface </a> is only available since no users have been created for the deployment. The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost interface </a> closes after the creation of the first user. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Create the user administrator. <a class="headerlink leafygreen-ui-1kepx47" href="#create-the-user-administrator" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-the-user-administrator"> </div> </a> </h4> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> After you create the first user, the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> localhost exception </a> is no longer available. </p> <p class="leafygreen-ui-1kp3ins"> The first user must have privileges to create other users, such as a user with the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-userAdminAnyDatabase"> <code class="leafygreen-ui-1l06pbn"> userAdminAnyDatabase </code> </a> . This ensures that you can create additional users after the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> Localhost Exception in Self-Managed Deployments </a> closes. </p> <p class="leafygreen-ui-1kp3ins"> If at least one user does <em> not </em> have privileges to create users, once the localhost exception closes you cannot create or modify users, and therefore may be unable to perform necessary operations. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> Add a user using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createUser/#mongodb-method-db.createUser"> <code class="leafygreen-ui-1l06pbn"> db.createUser() </code> </a> method. The user should have at minimum the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-userAdminAnyDatabase"> <code class="leafygreen-ui-1l06pbn"> userAdminAnyDatabase </code> </a> role on the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Passwords should be random, long, and complex to ensure system security and to prevent or delay malicious access. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example creates the user <code class="leafygreen-ui-1l06pbn"> fred </code> on the <code class="leafygreen-ui-1l06pbn"> admin </code> database: </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"admin = db.getSiblingDB(\"admin\")\nadmin.createUser(\n {\n user: \"fred\",\n pwd: passwordPrompt(), // or cleartext password\n roles: [ { role: \"userAdminAnyDatabase\", db: \"admin\" } ]\n }\n)\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">admin <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<span class="lg-highlight-string">"admin"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">admin.<span class="lg-highlight-title lg-highlight-function">createUser</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">user</span>: <span class="lg-highlight-string">"fred"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">pwd</span>: <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)<!-- -->, <span class="lg-highlight-comment">// or cleartext password</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">roles</span>: <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">role</span>: <span class="lg-highlight-string">"userAdminAnyDatabase"</span>, <span class="lg-highlight-attr">db</span>: <span class="lg-highlight-string">"admin"</span> } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-database-user-roles"> Database User Roles </a> for a full list of built-in roles and related to database administration operations. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Authenticate as the user administrator. <a class="headerlink leafygreen-ui-1kepx47" href="#authenticate-as-the-user-administrator" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="authenticate-as-the-user-administrator"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.auth/#mongodb-method-db.auth"> <code class="leafygreen-ui-1l06pbn"> db.auth() </code> </a> to authenticate as the user administrator to create additional users: </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.getSiblingDB(\"admin\").auth(\"fred\", passwordPrompt()) // or cleartext password\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<span class="lg-highlight-string">"admin"</span>).<span class="lg-highlight-title lg-highlight-function">auth</span>(<span class="lg-highlight-string">"fred"</span>, <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->)) <span class="lg-highlight-comment">// or cleartext password</span></td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Enter the password when prompted. </p> <p class="leafygreen-ui-1kp3ins"> Alternatively, connect a new <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> session to the target replica set member using the <code class="leafygreen-ui-1l06pbn"> -u &lt;username&gt; </code> , <code class="leafygreen-ui-1l06pbn"> -p &lt;password&gt; </code> , and the <code class="leafygreen-ui-1l06pbn"> --authenticationDatabase "admin" </code> parameters. You must use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/localhost-exception/#std-label-localhost-exception"> Localhost Exception in Self-Managed Deployments </a> to connect to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> . </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongosh -u \"fred\" -p --authenticationDatabase \"admin\"\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">mongosh -u "fred" -p --authenticationDatabase "admin"</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If you do not specify the password to the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/options/#std-option-mongosh.--password" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> -p </code> </span> </a> command-line option, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> prompts for the password. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Create Administrative User for Cluster Management <a class="headerlink leafygreen-ui-1kepx47" href="#create-administrative-user-for-cluster-management" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-administrative-user-for-cluster-management"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> The cluster administrator user has the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-clusterAdmin"> <code class="leafygreen-ui-1l06pbn"> clusterAdmin </code> </a> role, which grants access to replication and sharding operations. </p> <p class="leafygreen-ui-1kp3ins"> Create a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-clusterAdmin"> <code class="leafygreen-ui-1l06pbn"> clusterAdmin </code> </a> user in the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </p> <p class="leafygreen-ui-1kp3ins"> The following example creates the user <code class="leafygreen-ui-1l06pbn"> ravi </code> on the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Passwords should be random, long, and complex to ensure system security and to prevent or delay malicious access. </p> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.getSiblingDB(\"admin\").createUser(\n {\n \"user\" : \"ravi\",\n \"pwd\" : passwordPrompt(), // or cleartext password\n roles: [ { \"role\" : \"clusterAdmin\", \"db\" : \"admin\" } ]\n }\n)\n","programmingLanguage":"Shell"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light shell leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.getSiblingDB("admin").createUser(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> {</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "user" : "ravi",</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> "pwd" : passwordPrompt(), // or cleartext password</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> roles: [ { "role" : "clusterAdmin", "db" : "admin" } ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-cluster-admin-roles"> Cluster Administration Roles </a> for a full list of built-in roles related to replica set and sharded cluster operations. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 6 </div> </div> <div class="css-1ed38mk"> <section> <h4 class="contains-headerlink leafygreen-ui-1vzlt5f"> Create additional users (Optional). <a class="headerlink leafygreen-ui-1kepx47" href="#create-additional-users-optional" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-additional-users-optional"> </div> </a> </h4> <p class="leafygreen-ui-1kp3ins"> Create users to allow clients to connect and access the sharded cluster. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-database-user-roles"> Database User Roles </a> for available built-in roles, such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-read"> <code class="leafygreen-ui-1l06pbn"> read </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-readWrite"> <code class="leafygreen-ui-1l06pbn"> readWrite </code> </a> . You may also want additional administrative users. For more information on users, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-users/"> Users in Self-Managed Deployments <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To create additional users, you must authenticate as a user with <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-userAdminAnyDatabase"> <code class="leafygreen-ui-1l06pbn"> userAdminAnyDatabase </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-userAdmin"> <code class="leafygreen-ui-1l06pbn"> userAdmin </code> </a> roles. </p> </section> </div> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Add Shards to the Cluster <a class="headerlink leafygreen-ui-1kepx47" href="#add-shards-to-the-cluster" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="add-shards-to-the-cluster"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To proceed, you must be connected to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> and authenticated as the cluster administrator user for the sharded cluster. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This is the cluster administrator for the sharded cluster and <em> not </em> the shard-local cluster administrator. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> To add each shard to the cluster, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.addShard/#mongodb-method-sh.addShard"> <code class="leafygreen-ui-1l06pbn"> sh.addShard() </code> </a> method. If the shard is a replica set, specify the name of the replica set and specify a member of the set. In production deployments, <em> all </em> shards should be replica sets. </p> <p class="leafygreen-ui-1kp3ins"> The following operation adds a single shard replica set to the cluster: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.addShard( \"&lt;replsetname&gt;/s1-mongo1.example.net:27017\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShard</span>( <span class="lg-highlight-string">"&lt;replSetName&gt;/s1-mongo1.example.net:27017"</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following operation is an example of adding a standalone <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> shard to the cluster: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.addShard( \"s1-mongo1.example.net:27017\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShard</span>( <span class="lg-highlight-string">"s1-mongo1.example.net:27017"</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Repeat these steps until the cluster includes all shards. At this point, the sharded cluster enforces access control for the cluster as well as for internal communications between each sharded cluster component. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Shard a Collection <a class="headerlink leafygreen-ui-1kepx47" href="#shard-a-collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="shard-a-collection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To proceed, you must be connected to the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> and authenticated as the cluster administrator user for the sharded cluster. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This is the cluster administrator for the sharded cluster and <em> not </em> the shard-local cluster administrator. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> To shard a collection, use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.shardCollection/#mongodb-method-sh.shardCollection"> <code class="leafygreen-ui-1l06pbn"> sh.shardCollection() </code> </a> method. You must specify the full namespace of the collection and a document containing the shard key. </p> <p class="leafygreen-ui-1kp3ins"> Your selection of shard key affects the efficiency of sharding, as well as your ability to take advantage of certain sharding features such as <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/zone-sharding/#std-label-zone-sharding"> zones </a> . See the selection considerations listed in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-choose-a-shard-key/#std-label-sharding-shard-key-selection"> Choose a Shard Key <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If the collection already contains data, you must create an index on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key"> shard key </a> using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex"> <code class="leafygreen-ui-1l06pbn"> db.collection.createIndex() </code> </a> method before using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.shardCollection/#mongodb-method-sh.shardCollection"> <code class="leafygreen-ui-1l06pbn"> shardCollection() </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> If the collection is empty, MongoDB creates the index as part of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.shardCollection/#mongodb-method-sh.shardCollection"> <code class="leafygreen-ui-1l06pbn"> sh.shardCollection() </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> The following is an example of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.shardCollection/#mongodb-method-sh.shardCollection"> <code class="leafygreen-ui-1l06pbn"> sh.shardCollection() </code> </a> method: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.shardCollection(\"&lt;database&gt;.&lt;collection&gt;\", { &lt;key&gt; : &lt;direction&gt; } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">shardCollection</span>(<span class="lg-highlight-string">"&lt;database&gt;.&lt;collection&gt;"</span>, <!-- -->{ &lt;<!-- -->key<!-- -->&gt; <!-- -->: &lt;<!-- -->direction<!-- -->&gt; <!-- -->} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Next Steps <a class="headerlink leafygreen-ui-1kepx47" href="#next-steps" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="next-steps"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Create users to allow clients to connect to and interact with the sharded cluster. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#std-label-database-user-roles"> Database User Roles </a> for basic built-in roles to use in creating read-only and read-write users. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> x.509 Internal Authentication <a class="headerlink leafygreen-ui-1kepx47" href="#x.509-internal-authentication" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="x.509-internal-authentication"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> For details on using x.509 for internal authentication, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-x509-member-authentication/"> Use x.509 Certificate for Membership Authentication with Self-Managed MongoDB <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> To upgrade from keyfile internal authentication to x.509 internal authentication, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/upgrade-keyfile-to-x509/"> Upgrade Self-Managed MongoDB from Keyfile Authentication to x.509 Authentication <!-- --> . </a> </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-components/"> Sharded Cluster Components </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-requirements/"> Operational Restrictions in Sharded Clusters </a> </p> </li> </ul> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/moveChunk/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> moveChunk <a class="headerlink leafygreen-ui-1kepx47" href="#movechunk" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="movechunk"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#considerations" target="_self"> <span> Considerations </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.moveChunk" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-dbcommand-dbcmd.moveChunk"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Internal administrative command. Moves <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-chunk"> chunks </a> between <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard"> shards </a> . Issue the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.moveChunk" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> </span> </a> command via a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> instance while using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-admin-database"> admin database </a> . Use the following forms: </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> In <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#std-program-mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> , this command can also be run through the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.moveChunk/#mongodb-method-sh.moveChunk"> <code class="leafygreen-ui-1l06pbn"> sh.moveChunk() </code> </a> helper method <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> Helper methods are convenient for <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#std-program-mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> users, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { moveChunk : &lt;namespace&gt; ,\n find : &lt;query&gt; ,\n to : &lt;string&gt;,\n forceJumbo: &lt;boolean&gt;,\n _secondaryThrottle : &lt;boolean&gt;,\n writeConcern: &lt;document&gt;,\n _waitForDelete : &lt;boolean&gt; } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <!-- -->moveChunk <!-- -->: &lt;<!-- -->namespace<!-- -->&gt; <!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->find <!-- -->: &lt;<!-- -->query<!-- -->&gt; <!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->to <!-- -->: &lt;<!-- -->string<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">forceJumbo</span>: &lt;<!-- -->boolean<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->_secondaryThrottle <!-- -->: &lt;<!-- -->boolean<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">writeConcern</span>: &lt;<span class="lg-highlight-variable lg-highlight-language">document</span>&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->_waitForDelete <!-- -->: &lt;<!-- -->boolean<!-- -->&gt; <!-- -->} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Alternatively: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { moveChunk : &lt;namespace&gt; ,\n bounds : &lt;array&gt; ,\n to : &lt;string&gt;,\n forceJumbo: &lt;boolean&gt;,\n _secondaryThrottle : &lt;boolean&gt;,\n writeConcern: &lt;document&gt;,\n _waitForDelete : &lt;boolean&gt; } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <!-- -->moveChunk <!-- -->: &lt;<!-- -->namespace<!-- -->&gt; <!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->bounds <!-- -->: &lt;<!-- -->array<!-- -->&gt; <!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->to <!-- -->: &lt;<!-- -->string<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">forceJumbo</span>: &lt;<!-- -->boolean<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->_secondaryThrottle <!-- -->: &lt;<!-- -->boolean<!-- -->&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">writeConcern</span>: &lt;<span class="lg-highlight-variable lg-highlight-language">document</span>&gt;<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->_waitForDelete <!-- -->: &lt;<!-- -->boolean<!-- -->&gt; <!-- -->} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.moveChunk" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> </span> </a> command has the following fields: </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Field </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-namespace"> namespace </a> of the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-collection"> collection </a> where the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-chunk"> chunk </a> exists. Specify the collection's full namespace, including the database name. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> find </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> An equality match on the shard key that specifies the shard-key value of the chunk to move. Specify either the <code class="leafygreen-ui-1l06pbn"> bounds </code> field or the <code class="leafygreen-ui-1l06pbn"> find </code> field but not both. Do <strong> not </strong> use the <code class="leafygreen-ui-1l06pbn"> find </code> field to select chunks in collections that use a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-hashed-shard-key"> hashed shard key <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> bounds </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> array </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The bounds of a specific chunk to move. The array must consist of two documents that specify the lower and upper shard key values of a chunk to move. Specify either the <code class="leafygreen-ui-1l06pbn"> bounds </code> field or the <code class="leafygreen-ui-1l06pbn"> find </code> field but not both. Use <code class="leafygreen-ui-1l06pbn"> bounds </code> to select chunks in collections that use a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-hashed-shard-key"> hashed shard key <!-- --> . </a> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> to </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The name of the destination shard for the chunk. </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-movechunk-forceJumbo" target="_self"> <span> forceJumbo </span> </a> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <span class="leafygreen-ui-1qnjd6d" id="std-label-movechunk-forceJumbo"> </span> <p class="leafygreen-ui-1kp3ins"> Optional. A flag that determines if the command can move a chunk that is <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-balancer-administration/#std-label-migration-chunk-size-limit"> too large to migrate </a> . The chunk may or may not be labeled as <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-data-partitioning/#std-label-jumbo-chunk"> jumbo <!-- --> . </a> </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> true </code> , the command can move the chunk. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> false </code> , the command cannot move the chunk. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> The default is <code class="leafygreen-ui-1l06pbn"> false </code> . </p> <p class="leafygreen-ui-1kp3ins"> <strong class="css-4dei7l"> WARNING: </strong> </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> moveChunk </code> command with <code class="leafygreen-ui-1l06pbn"> forceJumbo=true </code> blocks read and write operations on the collection. </p> <p class="leafygreen-ui-1kp3ins"> This option causes the shard to migrate chunks even when they are larger than the configured chunk size. The collection remains unavailable for the duration of the migration. </p> <p class="leafygreen-ui-1kp3ins"> To migrate these large chunks without this long blocking period, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-sharded-cluster-balancer/#std-label-balance-chunks-that-exceed-size-limit"> Balance Ranges that Exceed Size Limit </a> instead. </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> _secondaryThrottle </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. For <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/wiredtiger/#std-label-storage-wiredtiger"> WiredTiger </a> , defaults to <code class="leafygreen-ui-1l06pbn"> false </code> . </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> true </code> , then by default, each document move during chunk migration propagates to at least one secondary before the balancer proceeds with the next document. This is equivalent to a write concern of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-number-"> <code class="leafygreen-ui-1l06pbn"> { w: 2 } </code> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Use the <code class="leafygreen-ui-1l06pbn"> writeConcern </code> option to specify a different write concern. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> If <code class="leafygreen-ui-1l06pbn"> false </code> , the balancer does not wait for replication to a secondary and instead continues with the next document. </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> For more information, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-sharded-cluster-balancer/#std-label-sharded-cluster-config-secondary-throttle"> Secondary Throttle <!-- --> . </a> </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> writeConcern </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. A document that expresses the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/"> write concern </a> that the <code class="leafygreen-ui-1l06pbn"> _secondaryThrottle </code> will use to wait for secondaries during the chunk migration. </p> <p class="leafygreen-ui-1kp3ins"> <code class="leafygreen-ui-1l06pbn"> writeConcern </code> requires <code class="leafygreen-ui-1l06pbn"> _secondaryThrottle: true </code> . </p> </div> </div> </td> </tr> <tr class="leafygreen-ui-15dvrnp"> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> _waitForDelete </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> boolean </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> Optional. Internal option for testing purposes. The default is <code class="leafygreen-ui-1l06pbn"> false </code> . If set to <code class="leafygreen-ui-1l06pbn"> true </code> , the delete phase of a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.moveChunk" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> </span> </a> operation blocks. </div> </div> </td> </tr> </tbody> </table> </div> <p class="leafygreen-ui-1kp3ins"> The value of <code class="leafygreen-ui-1l06pbn"> bounds </code> takes the form: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[ { hashedField : &lt;minvalue&gt; } ,\n { hashedField : &lt;maxvalue&gt; } ]","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[ <!-- -->{ <!-- -->hashedField <!-- -->: &lt;<!-- -->minValue<!-- -->&gt; <!-- -->} <!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <!-- -->hashedField <!-- -->: &lt;<!-- -->maxValue<!-- -->&gt; <!-- -->} ]</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-data-partitioning/#std-label-sharding-chunk-migration"> chunk migration </a> section describes how chunks move between shards on MongoDB. </p> </dd> </dl> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/split/#mongodb-dbcommand-dbcmd.split"> <code class="leafygreen-ui-1l06pbn"> split </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.moveChunk/#mongodb-method-sh.moveChunk"> <code class="leafygreen-ui-1l06pbn"> sh.moveChunk() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.splitAt/#mongodb-method-sh.splitAt"> <code class="leafygreen-ui-1l06pbn"> sh.splitAt() </code> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.splitFind/#mongodb-method-sh.splitFind"> <code class="leafygreen-ui-1l06pbn"> sh.splitFind() </code> </a> </p> </li> </ul> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is not supported in serverless instances. For more information, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Considerations <a class="headerlink leafygreen-ui-1kepx47" href="#considerations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="considerations"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Only use the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.moveChunk" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> </span> </a> in special circumstances such as preparing your <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-sharded-cluster"> sharded cluster </a> for an initial ingestion of data, or a large bulk import operation. In most cases allow the balancer to create and balance chunks in sharded clusters. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/create-chunks-in-sharded-cluster/"> Create Ranges in a Sharded Cluster </a> for more information. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Indexes <a class="headerlink leafygreen-ui-1kepx47" href="#indexes" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="indexes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.moveChunk" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> </span> </a> requires that all indexes exist on the target (i.e. <code class="leafygreen-ui-1l06pbn"> to </code> ) shard before migration and returns an error if a required index does not exist. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Meta Data Error <a class="headerlink leafygreen-ui-1kepx47" href="#meta-data-error" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="meta-data-error"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.moveChunk" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> </span> </a> returns the following error message if another metadata operation is in progress on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/config-database/#mongodb-data-config.chunks"> <code class="leafygreen-ui-1l06pbn"> chunks </code> </a> collection: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"errmsg: \"The collection's metadata lock is already taken.\""} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">errmsg: "The collection's metadata lock is already taken."</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> If another process, such as a balancer process, changes meta data while <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.moveChunk" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> </span> </a> is running, you may see this error. You may retry the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.moveChunk" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> </span> </a> operation without side effects. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> <code class="leafygreen-ui-1l06pbn"> maxCatchUpPercentageBeforeBlockingWrites </code> Server Parameter <a class="headerlink leafygreen-ui-1kepx47" href="#maxcatchuppercentagebeforeblockingwrites-server-parameter" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="maxcatchuppercentagebeforeblockingwrites-server-parameter"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 5.0, you can set the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.maxCatchUpPercentageBeforeBlockingWrites"> <code class="leafygreen-ui-1l06pbn"> maxCatchUpPercentageBeforeBlockingWrites </code> </a> to specify the maximum allowed percentage of data not yet migrated during a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.moveChunk" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> moveChunk </code> </span> </a> operation when compared to the total size (in MBs) of the chunk being transferred. </p> </section> </section> </section>
https://www.mongodb.com/docs/manual/release-notes/7.0-upgrade-replica-set/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Upgrade a Replica Set to 7.0 <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-a-replica-set-to-7.0" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upgrade-a-replica-set-to-7.0"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#upgrade-recommendations-and-checklists" target="_self"> <span> Upgrade Recommendations and Checklists </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#prerequisites" target="_self"> <span> Prerequisites </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#download-newversion-binaries" target="_self"> <span> Download <!-- --> 7.0 <!-- --> Binaries </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#upgrade-procedure" target="_self"> <span> Upgrade Procedure </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#additional-upgrade-procedures" target="_self"> <span> Additional Upgrade Procedures </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> Use this tutorial to upgrade from MongoDB <!-- --> 6.0 <!-- --> to MongoDB <!-- --> 7.0 <!-- --> . To upgrade to a new patch release within the same release series, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/upgrade-revision/#std-label-upgrade-to-latest-revision"> Upgrade to the Latest Self-Managed Patch Release of MongoDB <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Familiarize yourself with the content of this document, including thoroughly reviewing the prerequisites, prior to upgrading to MongoDB <!-- --> 7.0 <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> The following steps outline the procedure to upgrade a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> that is a replica set member from version <!-- --> 6.0 <!-- --> to <!-- --> 7.0 <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> If you need guidance on upgrading to <!-- --> 7.0 <!-- --> , <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/products/consulting?tck=docs_server" target="_self"> <span> MongoDB professional services </span> </a> offer major version upgrade support to help ensure a smooth transition without interruption to your MongoDB application. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Upgrade Recommendations and Checklists <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-recommendations-and-checklists" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upgrade-recommendations-and-checklists"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> When upgrading, consider the following: </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Upgrade Version Path <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-version-path" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upgrade-version-path"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To upgrade an existing MongoDB deployment to <!-- --> 7.0 <!-- --> , you must be running a <!-- --> 6.0-series <!-- --> release. </p> <p class="leafygreen-ui-1kp3ins"> To upgrade from a version earlier than the <!-- --> 6.0-series <!-- --> , you must successively upgrade major releases until you have upgraded to <!-- --> 6.0-series <!-- --> . For example, if you are running a <!-- --> 5.0-series <!-- --> , you must <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/6.0/#std-label-6.0-upgrade"> upgrade first to 6.0 </a> <em> before </em> you can upgrade to <!-- --> 7.0 <!-- --> . </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Check Driver Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#check-driver-compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="check-driver-compatibility"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Before you upgrade MongoDB, check that you're using a MongoDB <!-- --> 7.0 <!-- --> -compatible driver. Consult the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> driver documentation </span> </a> for your specific driver to verify compatibility with MongoDB <!-- --> 7.0 <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> Upgraded deployments that run on incompatible drivers might encounter unexpected or undefined behavior. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Preparedness <a class="headerlink leafygreen-ui-1kepx47" href="#preparedness" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="preparedness"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Before beginning your upgrade, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/7.0-compatibility/#std-label-7.0-compatibility"> Compatibility Changes in MongoDB 7.0 </a> document to ensure that your applications and deployments are compatible with MongoDB <!-- --> 7.0 <!-- --> . Resolve the incompatibilities in your deployment before starting the upgrade. </p> <p class="leafygreen-ui-1kp3ins"> Before upgrading MongoDB, always test your application in a staging environment before deploying the upgrade to your production environment. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Downgrade Consideration <a class="headerlink leafygreen-ui-1kepx47" href="#downgrade-consideration" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="downgrade-consideration"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You cannot downgrade your deployment's binary version without assistance from support. </p> <p class="leafygreen-ui-1kp3ins"> To learn more, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/8.0-downgrade/#std-label-8.0-downgrade"> Downgrade <!-- --> 8.0 <!-- --> to <!-- --> 7.0 <!-- --> . </a> </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Prerequisites <a class="headerlink leafygreen-ui-1kepx47" href="#prerequisites" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="prerequisites"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> All Members Version <a class="headerlink leafygreen-ui-1kepx47" href="#all-members-version" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="all-members-version"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> All replica set members must be running version <!-- --> 6.0 <!-- --> . To upgrade a replica set from <!-- --> 5.0-series <!-- --> and earlier, <em> first </em> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/6.0-upgrade-replica-set/#std-label-6.0-upgrade-replica-set"> upgrade all members of the replica set to the latest 6.0-series release </a> , and then follow the procedure to upgrade from MongoDB <!-- --> 6.0 <!-- --> to <!-- --> 7.0 <!-- --> . </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Feature Compatibility Version <a class="headerlink leafygreen-ui-1kepx47" href="#feature-compatibility-version" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="feature-compatibility-version"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <!-- --> 6.0 <!-- --> replica set must have <code class="leafygreen-ui-1l06pbn"> featureCompatibilityVersion </code> set to <code class="leafygreen-ui-1l06pbn"> "6.0" </code> . </p> <p class="leafygreen-ui-1kp3ins"> To ensure that all members of the replica set have <code class="leafygreen-ui-1l06pbn"> featureCompatibilityVersion </code> set to <code class="leafygreen-ui-1l06pbn"> "6.0" </code> , connect to each replica set member and check the <code class="leafygreen-ui-1l06pbn"> featureCompatibilityVersion </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">getParameter</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">featureCompatibilityVersion</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> All members should return a result that includes <code class="leafygreen-ui-1l06pbn"> "featureCompatibilityVersion" : { "version" : "6.0" } </code> . </p> <p class="leafygreen-ui-1kp3ins"> To set or update <code class="leafygreen-ui-1l06pbn"> featureCompatibilityVersion </code> , run the following command on the primary. A majority of the data-bearing members must be available: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { setFeatureCompatibilityVersion: \"6.0\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">setFeatureCompatibilityVersion</span>: <span class="lg-highlight-string">"6.0"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#mongodb-dbcommand-dbcmd.setFeatureCompatibilityVersion"> <code class="leafygreen-ui-1l06pbn"> setFeatureCompatibilityVersion </code> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Replica Set Member State <a class="headerlink leafygreen-ui-1kepx47" href="#replica-set-member-state" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="replica-set-member-state"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Ensure that no replica set member is in the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-states/#mongodb-replstate-replstate.ROLLBACK"> <code class="leafygreen-ui-1l06pbn"> ROLLBACK </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-states/#mongodb-replstate-replstate.RECOVERING"> <code class="leafygreen-ui-1l06pbn"> RECOVERING </code> </a> state by issuing the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetGetStatus/#mongodb-dbcommand-dbcmd.replSetGetStatus"> <code class="leafygreen-ui-1l06pbn"> replSetGetStatus </code> </a> command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { replSetGetStatus: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">replSetGetStatus</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Download <!-- --> 7.0 <!-- --> Binaries <a class="headerlink leafygreen-ui-1kepx47" href="#download-newversion-binaries" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="download-newversion-binaries"> </div> </a> </h2> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Use a Package Manager <a class="headerlink leafygreen-ui-1kepx47" href="#use-a-package-manager" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-a-package-manager"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you installed MongoDB from the MongoDB <code class="leafygreen-ui-1l06pbn"> apt </code> , <code class="leafygreen-ui-1l06pbn"> yum </code> , <code class="leafygreen-ui-1l06pbn"> dnf </code> , or <code class="leafygreen-ui-1l06pbn"> zypper </code> repositories, you should upgrade to <!-- --> 7.0 <!-- --> using your package manager. </p> <p class="leafygreen-ui-1kp3ins"> Follow the appropriate <a class="leafygreen-ui-tqgtui" href="/docs/manual/installation/#std-label-tutorial-installation"> 7.0 installation instructions </a> for your Linux system. This will involve adding a repository for the new release, then performing the actual upgrade process. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Manually <a class="headerlink leafygreen-ui-1kepx47" href="#manually" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="manually"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If you have not installed MongoDB using a package manager, you can manually download the MongoDB binaries from the <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/try/download?tck=docs_server" target="_self"> <span> MongoDB Download Center </span> </a> . </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/installation/#std-label-tutorial-installation"> 7.0 installation instructions </a> for more information. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Upgrade Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-procedure" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upgrade-procedure"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You can upgrade from MongoDB <!-- --> 6.0 <!-- --> to <!-- --> 7.0 <!-- --> using a "rolling" upgrade to minimize downtime by upgrading the members individually while the other members are available. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"To shut down the mongod process, use\nmongosh to connect to the replica set member and\nrun the following command:","name":"Shut down the replica set member."},{"@type":"HowToStep","text":"Upgrade the secondary\nmembers of the replica set one at a time:Replace the 6.0 binary with the 7.0 binary.Restart the member.","name":"Upgrade secondary members of the replica set."},{"@type":"HowToStep","text":"Connect mongosh to the primary and use\nrs.stepDown() to step down the primary\nand force an election of a new primary.","name":"Step down the replica set primary."},{"@type":"HowToStep","text":"When rs.status() shows that the primary has stepped down\nand another member has assumed PRIMARY state, upgrade the\nstepped-down primary:Shut down the stepped-down primary and replace the\nmongod binary with the 7.0 binary.Restart the member.","name":"Upgrade the primary."},{"@type":"HowToStep","text":"At this point, you can run the 7.0 binaries without the\n7.0 features that are incompatible with 6.0.To enable these 7.0 features, set the feature compatibility\nversion (fCV) to 7.0.Enabling these backwards-incompatible features can complicate the\ndowngrade process since you must remove any persisted backwards-incompatible\nfeatures before you downgrade.It is recommended that after upgrading, you allow your deployment to run\nwithout enabling these features for a burn-in period to ensure the\nlikelihood of downgrade is minimal. When you are confident that the\nlikelihood of downgrade is minimal, enable these features.Ensure that no initial sync is in progress. Running\nsetFeatureCompatibilityVersion command while an\ninitial sync is in progress will cause the initial sync to\nrestart.On the primary, run the setFeatureCompatibilityVersion\ncommand in the admin database:Setting featureCompatibilityVersion (fCV) : \"7.0\"\nimplicitly performs a replSetReconfig to add the\nterm field to the configuration document and blocks\nuntil the new configuration propagates to a majority of replica\nset members.This command must perform writes to an internal system\ncollection. If for any reason the command does not complete\nsuccessfully, you can safely retry the command on the primary as\nthe operation is idempotent.","name":"Enable backwards-incompatible 7.0 features."}],"name":"Upgrade Procedure","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Shut down the replica set member. <a class="headerlink leafygreen-ui-1kepx47" href="#shut-down-the-replica-set-member." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="shut-down-the-replica-set-member."> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> To shut down the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> process, use <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to connect to the replica set member and run the following command: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { shutdown: 1 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">shutdown</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Upgrade secondary members of the replica set. <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-secondary-members-of-the-replica-set." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upgrade-secondary-members-of-the-replica-set."> </div> </a> </h3> <span class="leafygreen-ui-1qnjd6d" id="std-label-7.0-upgrade-rs-secondaries"> </span> <p class="leafygreen-ui-1kp3ins"> Upgrade the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-members/#std-label-replica-set-secondary-members"> secondary </a> members of the replica set one at a time: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Replace the <!-- --> 6.0 <!-- --> binary with the <!-- --> 7.0 <!-- --> binary. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Restart the member. </p> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Step down the replica set primary. <a class="headerlink leafygreen-ui-1kepx47" href="#step-down-the-replica-set-primary." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="step-down-the-replica-set-primary."> </div> </a> </h3> <span class="leafygreen-ui-1qnjd6d" id="std-label-7.0-upgrade-rs-step-down-primary"> </span> <p class="leafygreen-ui-1kp3ins"> Connect <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> to the primary and use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.stepDown/#mongodb-method-rs.stepDown"> <code class="leafygreen-ui-1l06pbn"> rs.stepDown() </code> </a> to <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-step-down"> step down </a> the primary and force an election of a new primary. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Upgrade the primary. <a class="headerlink leafygreen-ui-1kepx47" href="#upgrade-the-primary." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="upgrade-the-primary."> </div> </a> </h3> <span class="leafygreen-ui-1qnjd6d" id="std-label-7.0-upgrade-rs-primary"> </span> <p class="leafygreen-ui-1kp3ins"> When <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/rs.status/#mongodb-method-rs.status"> <code class="leafygreen-ui-1l06pbn"> rs.status() </code> </a> shows that the primary has stepped down and another member has assumed <code class="leafygreen-ui-1l06pbn"> PRIMARY </code> state, upgrade the stepped-down primary: </p> <ol class="leafygreen-ui-rioki0" type="1"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Shut down the stepped-down primary and replace the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod"> <code class="leafygreen-ui-1l06pbn"> mongod </code> </a> binary with the <!-- --> 7.0 <!-- --> binary. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Restart the member. </p> </li> </ol> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Enable backwards-incompatible <!-- --> 7.0 <!-- --> features. <a class="headerlink leafygreen-ui-1kepx47" href="#enable-backwards-incompatible--features." title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="enable-backwards-incompatible--features."> </div> </a> </h3> <span class="leafygreen-ui-1qnjd6d" id="std-label-7.0-upgrade-enable-features-primary"> </span> <p class="leafygreen-ui-1kp3ins"> At this point, you can run the <!-- --> 7.0 <!-- --> binaries without the <!-- --> 7.0 <!-- --> <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/7.0/#std-label-7.0-downgrade-considerations"> features </a> that are incompatible with <!-- --> 6.0 <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> To enable these <!-- --> 7.0 <!-- --> features, set the feature compatibility version ( <code class="leafygreen-ui-1l06pbn"> fCV </code> ) to <!-- --> 7.0 <!-- --> . </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Enabling these backwards-incompatible features can complicate the downgrade process since you must remove any persisted backwards-incompatible features before you downgrade. </p> <p class="leafygreen-ui-1kp3ins"> It is recommended that after upgrading, you allow your deployment to run without enabling these features for a burn-in period to ensure the likelihood of downgrade is minimal. When you are confident that the likelihood of downgrade is minimal, enable these features. </p> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> Ensure that no initial sync is in progress. Running <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#mongodb-dbcommand-dbcmd.setFeatureCompatibilityVersion"> <code class="leafygreen-ui-1l06pbn"> setFeatureCompatibilityVersion </code> </a> command while an initial sync is in progress will cause the initial sync to restart. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> On the primary, run the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#mongodb-dbcommand-dbcmd.setFeatureCompatibilityVersion"> <code class="leafygreen-ui-1l06pbn"> setFeatureCompatibilityVersion </code> </a> command in the <code class="leafygreen-ui-1l06pbn"> admin </code> database: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.adminCommand( { setFeatureCompatibilityVersion: \"7.0\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">adminCommand</span>( <!-- -->{ <span class="lg-highlight-attr">setFeatureCompatibilityVersion</span>: <span class="lg-highlight-string">"7.0"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Setting <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/setFeatureCompatibilityVersion/#std-label-set-fcv"> featureCompatibilityVersion (fCV) : "7.0" </a> implicitly performs a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetReconfig/#mongodb-dbcommand-dbcmd.replSetReconfig"> <code class="leafygreen-ui-1l06pbn"> replSetReconfig </code> </a> to add the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/replica-configuration/#mongodb-rsconf-rsconf.term"> <code class="leafygreen-ui-1l06pbn"> term </code> </a> field to the configuration document and blocks until the new configuration propagates to a majority of replica set members. </p> <p class="leafygreen-ui-1kp3ins"> This command must perform writes to an internal system collection. If for any reason the command does not complete successfully, you can safely retry the command on the primary as the operation is idempotent. </p> </section> </div> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Additional Upgrade Procedures <a class="headerlink leafygreen-ui-1kepx47" href="#additional-upgrade-procedures" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="additional-upgrade-procedures"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To upgrade a standalone, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/7.0-upgrade-standalone/#std-label-7.0-upgrade-standalone"> Upgrade a Standalone to 7.0 <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> To upgrade a sharded cluster, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/release-notes/7.0-upgrade-sharded-cluster/#std-label-7.0-upgrade-sharded-cluster"> Upgrade a Sharded Cluster to 7.0 <!-- --> . </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/core/capped-collections/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Capped Collections <a class="headerlink leafygreen-ui-1kepx47" href="#capped-collections" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="capped-collections"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#restrictions" target="_self"> <span> Restrictions </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#command-syntax" target="_self"> <span> Command Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#use-cases" target="_self"> <span> Use Cases </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#get-started" target="_self"> <span> Get Started </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#oplog-collection" target="_self"> <span> Oplog Collection </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#_id-index" target="_self"> <span> _id Index </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#updates" target="_self"> <span> Updates </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#query-efficiency" target="_self"> <span> Query Efficiency </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#tailable-cursor" target="_self"> <span> Tailable Cursor </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#multiple-concurrent-writes" target="_self"> <span> Multiple Concurrent Writes </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#read-concern-snapshot" target="_self"> <span> Read Concern Snapshot </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self"> <span> Learn More </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> Capped collections are fixed-size collections that insert and retrieve documents based on insertion order. Capped collections work similarly to circular buffers: once a collection fills its allocated space, it makes room for new documents by overwriting the oldest documents in the collection. </p> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Restrictions <a class="headerlink leafygreen-ui-1kepx47" href="#restrictions" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="restrictions"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Capped collections cannot be sharded. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot create capped collections on <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/tutorial/create-serverless-instance/" target="_self"> <span> serverless instances <!-- --> . </span> </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> Capped collections are not supported in <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/stable-api/#std-label-stable-api"> Stable API </a> V1. </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> You cannot write to capped collections in <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions"> transactions <!-- --> . </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/out/#mongodb-pipeline-pipe.-out"> <code class="leafygreen-ui-1l06pbn"> $out </code> </a> aggregation pipeline stage cannot write results to a capped collection. </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Command Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#command-syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="command-syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following example creates a capped collection called <code class="leafygreen-ui-1l06pbn"> log </code> with a maximum size of 100,000 bytes. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.createCollection( \"log\", { capped: true, size: 100000 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">createCollection</span>( <span class="lg-highlight-string">"log"</span>, <!-- -->{ <span class="lg-highlight-attr">capped</span>: <span class="lg-highlight-literal">true</span>, <span class="lg-highlight-attr">size</span>: <span class="lg-highlight-number">100000</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> For more information on creating capped collections, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createCollection/#mongodb-method-db.createCollection"> <code class="leafygreen-ui-1l06pbn"> createCollection() </code> </a> or <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/create/#mongodb-dbcommand-dbcmd.create"> <code class="leafygreen-ui-1l06pbn"> create </code> . </a> </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Use Cases <a class="headerlink leafygreen-ui-1kepx47" href="#use-cases" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="use-cases"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Generally, <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-ttl/#std-label-index-feature-ttl"> TTL (Time To Live) indexes </a> offer better performance and more flexibility than capped collections. TTL indexes expire and remove data from normal collections based on the value of a date-typed field and a TTL value for the index. </p> <p class="leafygreen-ui-1kp3ins"> Capped collections serialize write operations and therefore have worse concurrent insert, update, and delete performance than non-capped collections. Before you create a capped collection, consider if you can use a TTL index instead. </p> <p class="leafygreen-ui-1kp3ins"> The most common use case for a capped collection is to store log information. When the capped collection reaches its maximum size, old log entries are automatically overwritten with new entries. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Get Started <a class="headerlink leafygreen-ui-1kepx47" href="#get-started" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="get-started"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To create and query capped collections, see these pages: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/capped-collections/create-capped-collection/#std-label-capped-collections-create"> Create a Capped Collection </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/capped-collections/query-capped-collection/#std-label-capped-collections-query"> Query a Capped Collection </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/capped-collections/check-if-collection-is-capped/#std-label-capped-collections-check"> Check if a Collection is Capped </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/capped-collections/convert-collection-to-capped/#std-label-capped-collections-convert"> Convert a Collection to Capped </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/capped-collections/change-size-capped-collection/#std-label-capped-collections-change-size"> Change the Size of a Capped Collection </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/capped-collections/change-max-docs-capped-collection/#std-label-capped-collections-change-max-docs"> Change Maximum Documents in a Capped Collection </a> </p> </li> </ul> <span class="leafygreen-ui-1qnjd6d" id="std-label-capped-collections-recommendations-and-restrictions"> </span> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Consider these behavioral details for capped collections. </p> <span class="leafygreen-ui-1qnjd6d" id="std-label-capped-collections-oplog"> </span> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Oplog Collection <a class="headerlink leafygreen-ui-1kepx47" href="#oplog-collection" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="oplog-collection"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog"> oplog.rs </a> collection that stores a log of the operations in a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set"> replica set </a> uses a capped collection. </p> <p class="leafygreen-ui-1kp3ins"> Unlike other capped collections, the oplog can grow past its configured size limit to avoid deleting the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/replSetGetStatus/#mongodb-data-replSetGetStatus.optimes.lastCommittedOpTime"> <code class="leafygreen-ui-1l06pbn"> majority commit point </code> . </a> </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> MongoDB rounds the capped size of the oplog up to the nearest integer multiple of 256, in bytes. </p> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> _id Index <a class="headerlink leafygreen-ui-1kepx47" href="#_id-index" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="_id-index"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Capped collections have an <code class="leafygreen-ui-1l06pbn"> _id </code> field and an index on the <code class="leafygreen-ui-1l06pbn"> _id </code> field by default. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Updates <a class="headerlink leafygreen-ui-1kepx47" href="#updates" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="updates"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Avoid updating data in a capped collection. Because capped collections are fixed-size, updates can cause your data to expand beyond the collection's allocated space, which can cause unexpected behavior. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Query Efficiency <a class="headerlink leafygreen-ui-1kepx47" href="#query-efficiency" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="query-efficiency"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-natural-order"> natural ordering </a> to retrieve the most recently inserted elements from the collection efficiently. This is similar to using the <code class="leafygreen-ui-1l06pbn"> tail </code> command on a log file. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Tailable Cursor <a class="headerlink leafygreen-ui-1kepx47" href="#tailable-cursor" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="tailable-cursor"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> You can use a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-tailable-cursor"> tailable cursor </a> with capped collections. Similar to the Unix <code class="leafygreen-ui-1l06pbn"> tail -f </code> command, the tailable cursor "tails" the end of a capped collection. As new documents are inserted into the capped collection, you can use the tailable cursor to continue retrieving documents. </p> <p class="leafygreen-ui-1kp3ins"> For information on creating a tailable cursor, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/tailable-cursors/#std-label-tailable-cursors-landing-page"> Tailable Cursors <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Multiple Concurrent Writes <a class="headerlink leafygreen-ui-1kepx47" href="#multiple-concurrent-writes" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="multiple-concurrent-writes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> If there are concurrent writers to a capped collection, MongoDB does not guarantee that documents are returned in insertion order. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Read Concern Snapshot <a class="headerlink leafygreen-ui-1kepx47" href="#read-concern-snapshot" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="read-concern-snapshot"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Starting in MongoDB 8.0, you can use read concern <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-snapshot/#mongodb-readconcern-readconcern.-snapshot-"> <code class="leafygreen-ui-1l06pbn"> "snapshot" </code> </a> on <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-manual-capped-collection" target="_self"> <span> capped </span> </a> collections. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Learn More <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="learn-more"> </div> </a> </h2> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/index-ttl/#std-label-index-feature-ttl"> TTL Indexes </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-properties/#std-label-index-properties"> Index Properties </a> </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/applications/indexes/#std-label-indexing-strategies"> Indexing Strategies </a> </p> </li> </ul> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/db.changeUserPassword/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> db.changeUserPassword() <a class="headerlink leafygreen-ui-1kepx47" href="#db.changeuserpassword--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="db.changeuserpassword--"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#required-access" target="_self"> <span> Required Access </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> db.changeUserPassword(username, password) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-db.changeUserPassword" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-db.changeUserPassword"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Updates a user's password. Run the method in the database where the user is defined, i.e. the database you <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createUser/#mongodb-method-db.createUser"> <code class="leafygreen-ui-1l06pbn"> created </code> </a> the user. </p> <div class="leafygreen-ui-85da11" role="note"> <h2 class="leafygreen-ui-1ac4g5h"> Important </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> mongosh Method </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This page documents a <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> method. This is <em> not </em> the documentation for database commands or language-specific drivers, such as Node.js. </p> <p class="leafygreen-ui-1kp3ins"> For the database command, see the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/updateUser/#mongodb-dbcommand-dbcmd.updateUser"> <code class="leafygreen-ui-1l06pbn"> updateUser </code> </a> command <!-- --> . </p> <p class="leafygreen-ui-1kp3ins"> For MongoDB API drivers, refer to the language-specific <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self"> <span> MongoDB driver documentation <!-- --> . </span> </a> </p> </div> </div> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:20%"/> <col style="width:20%"/> <col style="width:80%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Parameter </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Type </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Description </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> username </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> The name of the user whose password you wish to change. </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> password </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> string </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> The user's password. The value can be either: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> the user's password in cleartext string, or </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> to prompt for the user's password. </p> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </li> </ul> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> writeConcern </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> document </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <p class="leafygreen-ui-1kp3ins"> Optional. The level of <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern"> write concern </a> for the operation. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-specs"> Write Concern Specification <!-- --> . </a> </p> </div> </div> </td> </tr> </tbody> </table> </div> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Required Access <a class="headerlink leafygreen-ui-1kepx47" href="#required-access" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="required-access"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> To modify the password of another user on a database, you must have the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#mongodb-authaction-changePassword"> <code class="leafygreen-ui-1l06pbn"> changePassword </code> </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/privilege-actions/#std-label-security-user-actions"> action </a> on that database. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <div class="leafygreen-ui-1sjx7ru" role="note"> <h2 class="leafygreen-ui-29m78u"> Warning </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> By default, <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.changeUserPassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.changeUserPassword() </code> </span> </a> sends all specified data to the MongoDB instance in cleartext, even if using <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> . Use TLS transport encryption to protect communications between clients and the server, including the password sent by <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.changeUserPassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.changeUserPassword() </code> </span> </a> . For instructions on enabling TLS transport encryption, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-ssl/"> Configure <code class="leafygreen-ui-1l06pbn"> mongod </code> and <code class="leafygreen-ui-1l06pbn"> mongos </code> for TLS/SSL <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> MongoDB does not store the password in cleartext. The password is only vulnerable in transit between the client and the server, and only if TLS transport encryption is not enabled. </p> </div> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following operation changes the password of the user named <code class="leafygreen-ui-1l06pbn"> accountUser </code> in the <code class="leafygreen-ui-1l06pbn"> products </code> database to <code class="leafygreen-ui-1l06pbn"> SOh3TbYhx8ypJPxmt1oOfL </code> : </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> You can use the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/passwordPrompt/#mongodb-method-passwordPrompt"> <code class="leafygreen-ui-1l06pbn"> passwordPrompt() </code> </a> method in conjunction with various user authentication management methods and commands to prompt for the password instead of specifying the password directly in the method or command call. However, you can still specify the password directly as you would with earlier versions of the <code class="leafygreen-ui-1l06pbn"> mongo </code> shell. </p> </div> </div> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use products\ndb.changeUserPassword(\"accountUser\", passwordPrompt())","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use products</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">changeUserPassword</span>(<span class="lg-highlight-string">"accountUser"</span>, <span class="lg-highlight-title lg-highlight-function">passwordPrompt</span>(<!-- -->))</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> When prompted in <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> mongosh </code> </span> </a> for the password, enter the new password. </p> <p class="leafygreen-ui-1kp3ins"> You can also pass the new password directly to <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-method-db.changeUserPassword" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> db.changeUserPassword() </code> : </span> </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"use products\ndb.changeUserPassword(\"accountUser\", \"SOh3TbYhx8ypJPxmt1oOfL\")","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">use products</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">changeUserPassword</span>(<span class="lg-highlight-string">"accountUser"</span>, <span class="lg-highlight-string">"SOh3TbYhx8ypJPxmt1oOfL"</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/tutorial/sharding-segmenting-shards/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> Segmenting Data by Application or Customer <a class="headerlink leafygreen-ui-1kepx47" href="#segmenting-data-by-application-or-customer" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="segmenting-data-by-application-or-customer"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#scenario" target="_self"> <span> Scenario </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#procedure" target="_self"> <span> Procedure </span> </a> </li> </ul> </div> <p class="leafygreen-ui-1kp3ins"> In sharded clusters, you can create <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-zone"> zones </a> of sharded data based on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key"> shard key </a> . You can associate each zone with one or more shards in the cluster. A shard can associate with any number of zones. In a balanced cluster, MongoDB migrates <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-chunk"> chunks </a> covered by a zone only to those shards associated with the zone. </p> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> By defining the zones and the zone ranges <em> before </em> sharding an empty or a non-existing collection, the shard collection operation creates chunks for the defined zone ranges as well as any additional chunks to cover the entire range of the shard key values and performs an initial chunk distribution based on the zone ranges. This initial creation and distribution of chunks allows for faster setup of zoned sharding. After the initial distribution, the balancer manages the chunk distribution going forward. </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.updateZoneKeyRange/#std-label-pre-define-zone-range-example"> Pre-Define Zones and Zone Ranges for an Empty or Non-Existing Collection </a> for an example. </p> </div> </div> <p class="leafygreen-ui-1kp3ins"> This tutorial shows you how to segment data using <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/zone-sharding/#std-label-zone-sharding"> Zones <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> Consider the following scenarios where segmenting data by application or customer may be necessary: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A database serving multiple applications </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A database serving multiple customers </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A database that requires isolating ranges or subsets of application or customer data </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> A database that requires resource allocation for ranges or subsets of application or customer data </p> </li> </ul> <p class="leafygreen-ui-1kp3ins"> This diagram illustrates a sharded cluster using zones to segment data based on application or customer. This allows for data to be isolated to specific shards. Additionally, each shard can have specific hardware allocated to fit the performance requirement of the data stored on that shard. </p> <div class="figure css-5vkxs0" style="width:700px"> <img alt="Overview of zones used for supporting data segmentation" class="leafygreen-ui-1qnf57e" height="400" src="/docs/manual/images/sharding-segmenting-shards-overview.bakedsvg.svg" style="--border-color:#C1C7C6" width="582"/> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Scenario <a class="headerlink leafygreen-ui-1kepx47" href="#scenario" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="scenario"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> An application tracks the score of a user along with a <code class="leafygreen-ui-1l06pbn"> client </code> field, storing scores in the <code class="leafygreen-ui-1l06pbn"> gamify </code> database under the <code class="leafygreen-ui-1l06pbn"> users </code> collection. Each possible value of <code class="leafygreen-ui-1l06pbn"> client </code> requires its own zone to allow for data segmentation. It also allows the administrator to optimize the hardware for each shard associated to a <code class="leafygreen-ui-1l06pbn"> client </code> for performance and cost. </p> <p class="leafygreen-ui-1kp3ins"> The following documents represent a partial view of two users: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n \"_id\" : ObjectId(\"56f08c447fe58b2e96f595fa\"),\n \"client\" : \"robot\",\n \"userid\" : 123,\n \"high_score\" : 181,\n ...,\n}\n{\n \"_id\" : ObjectId(\"56f08c447fe58b2e96f595fb\"),\n \"client\" : \"fruitos\",\n \"userid\" : 456,\n \"high_score\" : 210,\n ...,\n}","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"56f08c447fe58b2e96f595fa"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"client"</span> <!-- -->: <span class="lg-highlight-string">"robot"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"userid"</span> <!-- -->: <span class="lg-highlight-number">123</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"high_score"</span> <!-- -->: <span class="lg-highlight-number">181</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"56f08c447fe58b2e96f595fb"</span>)<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"client"</span> <!-- -->: <span class="lg-highlight-string">"fruitos"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"userid"</span> <!-- -->: <span class="lg-highlight-number">456</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"high_score"</span> <!-- -->: <span class="lg-highlight-number">210</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->...<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Shard Key <a class="headerlink leafygreen-ui-1kepx47" href="#shard-key" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="shard-key"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> users </code> collection uses the <code class="leafygreen-ui-1l06pbn"> { client : 1, userid : 1 } </code> compound index as the shard key. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> client </code> field in each document allows creating a zone for each distinct client value. </p> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> userid </code> field provides a high <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-choose-a-shard-key/#std-label-shard-key-cardinality"> cardinality </a> and low <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-choose-a-shard-key/#std-label-shard-key-frequency"> frequency </a> component to the shard key relative to <code class="leafygreen-ui-1l06pbn"> country </code> . </p> <p class="leafygreen-ui-1kp3ins"> See <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-choose-a-shard-key/#std-label-sharding-shard-key-requirements"> Choosing a Shard Key </a> for more general instructions on selecting a shard key. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Architecture <a class="headerlink leafygreen-ui-1kepx47" href="#architecture" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="architecture"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The application requires adding shard to a zone associated to a specific <code class="leafygreen-ui-1l06pbn"> client </code> . </p> <p class="leafygreen-ui-1kp3ins"> The sharded cluster deployment currently consists of four <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard"> shards <!-- --> . </a> </p> <div class="figure css-5vkxs0" style="width:700px"> <img alt="Diagram of Data Segmentation Architecture using zones" class="leafygreen-ui-1qnf57e" height="400" src="/docs/manual/images/sharding-segmenting-shards-architecture.bakedsvg.svg" style="--border-color:#C1C7C6" width="582"/> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Zones <a class="headerlink leafygreen-ui-1kepx47" href="#zones" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="zones"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> For this application, there are two client zones. </p> <div class="figure css-5vkxs0" style="width:700px"> <img alt="Diagram of zones used for supporting data segmentation" class="leafygreen-ui-1qnf57e" height="400" src="/docs/manual/images/sharding-segmenting-shards-tags.bakedsvg.svg" style="--border-color:#C1C7C6" width="582"/> </div> <dl> <dt> Robot client ("robot") </dt> <dd class="css-1ufxuu7"> This zone represents all documents where <code class="leafygreen-ui-1l06pbn"> client : robot </code> . </dd> <dt> FruitOS client ("fruitos") </dt> <dd class="css-1ufxuu7"> This zone represents all documents where <code class="leafygreen-ui-1l06pbn"> client : fruitos </code> . </dd> </dl> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Write Operations <a class="headerlink leafygreen-ui-1kepx47" href="#write-operations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="write-operations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> With zones, if an inserted or updated document matches a configured zone, it can only be written to a shard inside that zone. </p> <p class="leafygreen-ui-1kp3ins"> MongoDB can write documents that do not match a configured zone to any shard in the cluster. </p> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> The behavior described above requires the cluster to be in a steady state with no chunks violating a configured zone. See the following section on the <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/sharding-tiered-hardware-for-varying-slas/#std-label-sharding-tiered-hardware-balancing"> balancer </a> for more information. </p> </div> </div> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Read Operations <a class="headerlink leafygreen-ui-1kepx47" href="#read-operations" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="read-operations"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> MongoDB can route queries to a specific shard if the query includes at least the <code class="leafygreen-ui-1l06pbn"> client </code> field. </p> <p class="leafygreen-ui-1kp3ins"> For example, MongoDB can attempt a <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-query-router/#std-label-sharding-mongos-targeted"> targeted read operation </a> on the following query: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"chatDB = db.getSiblingDB(\"gamify\")\nchatDB.users.find( { \"client\" : \"robot\" , \"userid\" : \"123\" } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">chatDB <!-- -->= <!-- -->db.<span class="lg-highlight-title lg-highlight-function">getSiblingDB</span>(<span class="lg-highlight-string">"gamify"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">chatDB.<span class="lg-highlight-property">users</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-string">"client"</span> <!-- -->: <span class="lg-highlight-string">"robot"</span> <!-- -->, <span class="lg-highlight-string">"userid"</span> <!-- -->: <span class="lg-highlight-string">"123"</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Queries without the <code class="leafygreen-ui-1l06pbn"> client </code> field perform <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-query-router/#std-label-sharding-mongos-broadcast"> broadcast operations <!-- --> . </a> </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Balancer <a class="headerlink leafygreen-ui-1kepx47" href="#balancer" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="balancer"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-balancer-administration/#std-label-sharding-balancing"> balancer </a> <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-data-partitioning/#std-label-sharding-chunk-migration"> migrates </a> chunks to the appropriate shard respecting any configured zones. Until the migration, shards may contain chunks that violate configured zones. Once balancing completes, shards should only contain chunks whose ranges do not violate its assigned zones. </p> <p class="leafygreen-ui-1kp3ins"> Adding or removing zones or zone ranges can result in chunk migrations. Depending on the size of your data set and the number of chunks a zone or zone range affects, these migrations may impact cluster performance. Consider running your <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-balancer-administration/#std-label-sharding-balancing"> balancer </a> during specific scheduled windows. See <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/manage-sharded-cluster-balancer/#std-label-sharding-schedule-balancing-window"> Schedule the Balancing Window </a> for a tutorial on how to set a scheduling window. </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Security <a class="headerlink leafygreen-ui-1kepx47" href="#security" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="security"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> For sharded clusters running with <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authorization/#std-label-authorization"> Role-Based Access Control in Self-Managed Deployments </a> , authenticate as a user with at least the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/built-in-roles/#mongodb-authrole-clusterManager"> <code class="leafygreen-ui-1l06pbn"> clusterManager </code> </a> role on the <code class="leafygreen-ui-1l06pbn"> admin </code> database. </p> </section> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Procedure <a class="headerlink leafygreen-ui-1kepx47" href="#procedure" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="procedure"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> You must be connected to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos"> <code class="leafygreen-ui-1l06pbn"> mongos </code> </a> associated to the target <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-sharded-cluster"> sharded cluster </a> to proceed. You cannot create zones or zone ranges by connecting directly to a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard"> shard <!-- --> . </a> </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"HowTo","steps":[{"@type":"HowToStep","text":"Disable the BalancerThe balancer must be disabled on the entire sharded cluster\nto ensure no migrations take place while configuring the new zones.Use sh.stopBalancer() to stop the balancer for the cluster.Use sh.isBalancerRunning() to check if the balancer process\nis currently running. Wait until any current balancing rounds have completed\nbefore proceeding."},{"@type":"HowToStep","text":"Add each shard to the appropriate zoneAdd shard0000 to the robot zone.Add shard0001 to the robot zone.Add shard0002 to the fruitos zone.Add shard0003 to the fruitos zone.Run sh.status() to review the zone configured for the sharded\ncluster."},{"@type":"HowToStep","text":"Define ranges for each zoneDefine range for the robot client and associate it to the robot\nzone using the sh.addTagRange() method.This method requires:The full namespace of the target collectionThe inclusive lower bound of the rangeThe exclusive upper bound of the rangeThe name of the zoneDefine range for the fruitos client and associate it to the\nfruitos zone using the sh.addTagRange() method.This method requires:The full namespace of the target collectionThe inclusive lower bound of the rangeThe exclusive upper bound of the rangeThe name of the zoneThe MinKey and MaxKey values are reserved special\nvalues for comparisons. MinKey always compares as lower than\nevery other possible value, while MaxKey always compares as\nhigher than every other possible value. The configured ranges captures every\nuser for each client."},{"@type":"HowToStep","text":"Enable the BalancerRe-enable the balancer to rebalance the cluster.Use sh.enableBalancing(), specifying the namespace of the\ncollection, to start the balancer.Use sh.isBalancerRunning() to check if the balancer process\nis currently running."},{"@type":"HowToStep","text":"Review the changesThe next time the balancer runs, it\nmigrates data across the shards\nrespecting the configured zones.Once balancing finishes, the shards in the robot zone only contain\ndocuments with client : robot, while shards in the fruitos zone only\ncontain documents with client : fruitos.You can confirm the chunk distribution by running sh.status()."}],"name":"Procedure","image":"https://webimages.mongodb.com/_com_assets/cms/kuyj2focmkbxv7gh3-stacked_default_slate_blue.svg?auto=format%252Ccompress"} </script> <div class="css-4nyere eccljxs0"> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 1 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Disable the Balancer <a class="headerlink leafygreen-ui-1kepx47" href="#disable-the-balancer" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="disable-the-balancer"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The balancer must be disabled on the entire sharded cluster to ensure no migrations take place while configuring the new zones. </p> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.stopBalancer/#mongodb-method-sh.stopBalancer"> <code class="leafygreen-ui-1l06pbn"> sh.stopBalancer() </code> </a> to stop the balancer for the cluster. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.stopBalancer()\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">stopBalancer</span>(<!-- -->)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.isBalancerRunning/#mongodb-method-sh.isBalancerRunning"> <code class="leafygreen-ui-1l06pbn"> sh.isBalancerRunning() </code> </a> to check if the balancer process is currently running. Wait until any current balancing rounds have completed before proceeding. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 2 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Add each shard to the appropriate zone <a class="headerlink leafygreen-ui-1kepx47" href="#add-each-shard-to-the-appropriate-zone" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="add-each-shard-to-the-appropriate-zone"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Add <code class="leafygreen-ui-1l06pbn"> shard0000 </code> to the <code class="leafygreen-ui-1l06pbn"> robot </code> zone. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.addShardTag(\"shard0000\", \"robot\")\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShardTag</span>(<span class="lg-highlight-string">"shard0000"</span>, <span class="lg-highlight-string">"robot"</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Add <code class="leafygreen-ui-1l06pbn"> shard0001 </code> to the <code class="leafygreen-ui-1l06pbn"> robot </code> zone. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.addShardTag(\"shard0001\", \"robot\")\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShardTag</span>(<span class="lg-highlight-string">"shard0001"</span>, <span class="lg-highlight-string">"robot"</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Add <code class="leafygreen-ui-1l06pbn"> shard0002 </code> to the <code class="leafygreen-ui-1l06pbn"> fruitos </code> zone. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.addShardTag(\"shard0002\", \"fruitos\")\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShardTag</span>(<span class="lg-highlight-string">"shard0002"</span>, <span class="lg-highlight-string">"fruitos"</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Add <code class="leafygreen-ui-1l06pbn"> shard0003 </code> to the <code class="leafygreen-ui-1l06pbn"> fruitos </code> zone. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.addShardTag(\"shard0003\", \"fruitos\")\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addShardTag</span>(<span class="lg-highlight-string">"shard0003"</span>, <span class="lg-highlight-string">"fruitos"</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Run <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.status/#mongodb-method-sh.status"> <code class="leafygreen-ui-1l06pbn"> sh.status() </code> </a> to review the zone configured for the sharded cluster. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 3 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Define ranges for each zone <a class="headerlink leafygreen-ui-1kepx47" href="#define-ranges-for-each-zone" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="define-ranges-for-each-zone"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Define range for the <code class="leafygreen-ui-1l06pbn"> robot </code> client and associate it to the <code class="leafygreen-ui-1l06pbn"> robot </code> zone using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.addTagRange/#mongodb-method-sh.addTagRange"> <code class="leafygreen-ui-1l06pbn"> sh.addTagRange() </code> </a> method. </p> <p class="leafygreen-ui-1kp3ins"> This method requires: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The full namespace of the target collection </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The inclusive lower bound of the range </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The exclusive upper bound of the range </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The name of the zone </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.addTagRange( \n \"gamify.users\",\n { \"client\" : \"robot\", \"userid\" : MinKey },\n { \"client\" : \"robot\", \"userid\" : MaxKey }, \n \"robot\"\n)\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addTagRange</span>( </td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"gamify.users"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"client"</span> <!-- -->: <span class="lg-highlight-string">"robot"</span>, <span class="lg-highlight-string">"userid"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">MinKey</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"client"</span> <!-- -->: <span class="lg-highlight-string">"robot"</span>, <span class="lg-highlight-string">"userid"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">MaxKey</span> }<!-- -->, </td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"robot"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Define range for the <code class="leafygreen-ui-1l06pbn"> fruitos </code> client and associate it to the <code class="leafygreen-ui-1l06pbn"> fruitos </code> zone using the <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.addTagRange/#mongodb-method-sh.addTagRange"> <code class="leafygreen-ui-1l06pbn"> sh.addTagRange() </code> </a> method. </p> <p class="leafygreen-ui-1kp3ins"> This method requires: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The full namespace of the target collection </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The inclusive lower bound of the range </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The exclusive upper bound of the range </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> The name of the zone </p> </li> </ul> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.addTagRange( \n \"gamify.users\",\n { \"client\" : \"fruitos\", \"userid\" : MinKey },\n { \"client\" : \"fruitos\", \"userid\" : MaxKey }, \n \"fruitos\"\n)\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">addTagRange</span>( </td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"gamify.users"</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"client"</span> <!-- -->: <span class="lg-highlight-string">"fruitos"</span>, <span class="lg-highlight-string">"userid"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">MinKey</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{ <span class="lg-highlight-string">"client"</span> <!-- -->: <span class="lg-highlight-string">"fruitos"</span>, <span class="lg-highlight-string">"userid"</span> <!-- -->: <span class="lg-highlight-title lg-highlight-class">MaxKey</span> }<!-- -->, </td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-string">"fruitos"</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-MinKey"> <code class="leafygreen-ui-1l06pbn"> MinKey </code> </a> and <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-MaxKey"> <code class="leafygreen-ui-1l06pbn"> MaxKey </code> </a> values are reserved special values for comparisons. <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-MinKey"> <code class="leafygreen-ui-1l06pbn"> MinKey </code> </a> always compares as lower than every other possible value, while <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-MaxKey"> <code class="leafygreen-ui-1l06pbn"> MaxKey </code> </a> always compares as higher than every other possible value. The configured ranges captures every user for each <code class="leafygreen-ui-1l06pbn"> client </code> . </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 4 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Enable the Balancer <a class="headerlink leafygreen-ui-1kepx47" href="#enable-the-balancer" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="enable-the-balancer"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> Re-enable the balancer to rebalance the cluster. </p> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.enableBalancing/#mongodb-method-sh.enableBalancing"> <code class="leafygreen-ui-1l06pbn"> sh.enableBalancing() </code> </a> , specifying the namespace of the collection, to start the balancer. </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"sh.enableBalancing(\"chat.message\")\n","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">sh.<span class="lg-highlight-title lg-highlight-function">enableBalancing</span>(<span class="lg-highlight-string">"chat.message"</span>)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Use <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.isBalancerRunning/#mongodb-method-sh.isBalancerRunning"> <code class="leafygreen-ui-1l06pbn"> sh.isBalancerRunning() </code> </a> to check if the balancer process is currently running. </p> </section> </div> </div> <div class="css-1nuklj8 e1ckbxcu1"> <div class="css-18fui5z e1ckbxcu0"> <div class="css-19lsqsq e1ckbxcu2"> 5 </div> </div> <div class="css-1ed38mk"> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Review the changes <a class="headerlink leafygreen-ui-1kepx47" href="#review-the-changes" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="review-the-changes"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The next time the <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-balancer-administration/#std-label-sharding-balancing"> balancer </a> runs, it <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-data-partitioning/#std-label-sharding-chunk-migration"> migrates </a> data across the shards respecting the configured zones. </p> <p class="leafygreen-ui-1kp3ins"> Once balancing finishes, the shards in the <code class="leafygreen-ui-1l06pbn"> robot </code> zone only contain documents with <code class="leafygreen-ui-1l06pbn"> client : robot </code> , while shards in the <code class="leafygreen-ui-1l06pbn"> fruitos </code> zone only contain documents with <code class="leafygreen-ui-1l06pbn"> client : fruitos </code> . </p> <p class="leafygreen-ui-1kp3ins"> You can confirm the chunk distribution by running <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.status/#mongodb-method-sh.status"> <code class="leafygreen-ui-1l06pbn"> sh.status() </code> . </a> </p> </section> </div> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/operator/aggregation/ln/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> $ln (aggregation) <a class="headerlink leafygreen-ui-1kepx47" href="#-ln--aggregation-" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="-ln--aggregation-"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self"> <span> Behavior </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#example" target="_self"> <span> Example </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="expression"> <dt> <code class="leafygreen-ui-1l06pbn"> $ln </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-expression-exp.-ln" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-expression-exp.-ln"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> Calculates the natural logarithm <em> ln </em> (i.e log <sub> e </sub> ) of a number and returns the result as a double. </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-ln" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $ln </code> </span> </a> has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ $ln: &lt;number&gt; }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">$ln</span>: &lt;<!-- -->number<!-- -->&gt; <!-- -->}</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> &lt;number&gt; </code> expression can be any valid <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> expression </a> as long as it resolves to a non-negative number. For more information on expressions, see <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/#std-label-aggregation-expressions"> Expression Operators <!-- --> . </a> </p> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-expression-exp.-ln" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> $ln </code> </span> </a> is equivalent to <code class="leafygreen-ui-1l06pbn"> $log: [ &lt;number&gt;, Math.E ] </code> expression, where <code class="leafygreen-ui-1l06pbn"> Math.E </code> is a JavaScript representation for Euler's number <em> e </em> . </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Behavior <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="behavior"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The default return type is a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Double"> <code class="leafygreen-ui-1l06pbn"> double </code> </a> . If at least one operand is a <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/#mongodb-bsontype-Decimal128"> <code class="leafygreen-ui-1l06pbn"> decimal </code> </a> , then the return type is a decimal. </p> <p class="leafygreen-ui-1kp3ins"> If the argument resolves to a value of <code class="leafygreen-ui-1l06pbn"> null </code> or refers to a field that is missing, <code class="leafygreen-ui-1l06pbn"> $ln </code> returns <code class="leafygreen-ui-1l06pbn"> null </code> . If the argument resolves to <code class="leafygreen-ui-1l06pbn"> NaN </code> , <code class="leafygreen-ui-1l06pbn"> $ln </code> returns <code class="leafygreen-ui-1l06pbn"> NaN </code> . </p> <div class="leafygreen-ui-skkc39" tabindex="0"> <table class="leafygreen-ui-hr8lsv"> <colgroup> <col style="width:85%"/> <col style="width:15%"/> </colgroup> <thead class="leafygreen-ui-a9ho40"> <tr data-testid="leafygreen-ui-header-row"> <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Example </div> </div> </th> <th class="leafygreen-ui-13uteka" role="columnheader" scope="col"> <div class="leafygreen-ui-ui0te9"> <div> Results </div> </div> </th> </tr> </thead> <tbody> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $ln: 1 } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 0 </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $ln: Math.E } </code> where <code class="leafygreen-ui-1l06pbn"> Math.E </code> is a JavaScript representation for <em> e </em> . </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 1 </code> </div> </div> </td> </tr> <tr class=""> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> { $ln: 10 } </code> </div> </div> </td> <td class="leafygreen-ui-1drjk7h"> <div class="leafygreen-ui-1n4j8xf"> <div> <code class="leafygreen-ui-1l06pbn"> 2.302585092994046 </code> </div> </div> </td> </tr> </tbody> </table> </div> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Example <a class="headerlink leafygreen-ui-1kepx47" href="#example" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="example"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> A collection <code class="leafygreen-ui-1l06pbn"> sales </code> contains the following documents: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ _id: 1, year: \"2000\", sales: 8700000 }\n{ _id: 2, year: \"2005\", sales: 5000000 }\n{ _id: 3, year: \"2010\", sales: 6250000 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">year</span>: <span class="lg-highlight-string">"2000"</span>, <span class="lg-highlight-attr">sales</span>: <span class="lg-highlight-number">8700000</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-attr">year</span>: <span class="lg-highlight-string">"2005"</span>, <span class="lg-highlight-attr">sales</span>: <span class="lg-highlight-number">5000000</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-attr">year</span>: <span class="lg-highlight-string">"2010"</span>, <span class="lg-highlight-attr">sales</span>: <span class="lg-highlight-number">6250000</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The following example transforms the <code class="leafygreen-ui-1l06pbn"> sales </code> data: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.sales.aggregate( [ { $project: { x: \"$year\", y: { $ln: \"$sales\" } } } ] )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">sales</span>.<span class="lg-highlight-title lg-highlight-function">aggregate</span>( <!-- -->[ <!-- -->{ <span class="lg-highlight-attr">$project</span>: <!-- -->{ <span class="lg-highlight-attr">x</span>: <span class="lg-highlight-string">"$year"</span>, <span class="lg-highlight-attr">y</span>: <!-- -->{ <span class="lg-highlight-attr">$ln</span>: <span class="lg-highlight-string">"$sales"</span> } } } ] )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The operation returns the following results: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"_id\" : 1, \"x\" : \"2000\", \"y\" : 15.978833583624812 }\n{ \"_id\" : 2, \"x\" : \"2005\", \"y\" : 15.424948470398375 }\n{ \"_id\" : 3, \"x\" : \"2010\", \"y\" : 15.648092021712584 }","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-string">"x"</span> <!-- -->: <span class="lg-highlight-string">"2000"</span>, <span class="lg-highlight-string">"y"</span> <!-- -->: <span class="lg-highlight-number">15.978833583624812</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">2</span>, <span class="lg-highlight-string">"x"</span> <!-- -->: <span class="lg-highlight-string">"2005"</span>, <span class="lg-highlight-string">"y"</span> <!-- -->: <span class="lg-highlight-number">15.424948470398375</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> <!-- -->: <span class="lg-highlight-number">3</span>, <span class="lg-highlight-string">"x"</span> <!-- -->: <span class="lg-highlight-string">"2010"</span>, <span class="lg-highlight-string">"y"</span> <!-- -->: <span class="lg-highlight-number">15.648092021712584</span> }</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <div class="leafygreen-ui-13vw3ie" role="note"> <h2 class="leafygreen-ui-1fn4p2b"> Tip </h2> <h3 class="leafygreen-ui-144d5kf"> <strong> See also: </strong> </h3> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/log/#mongodb-expression-exp.-log"> <code class="leafygreen-ui-1l06pbn"> $log </code> </a> </p> </div> </div> </section> </section>
https://www.mongodb.com/docs/manual/reference/method/ObjectId.createFromHexString/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> ObjectId.createFromHexString() <a class="headerlink leafygreen-ui-1kepx47" href="#objectid.createfromhexstring--" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="objectid.createfromhexstring--"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#examples" target="_self"> <span> Examples </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> Creates an <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-ObjectId"> ObjectId </a> from a hexadecimal value. </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <dl class="method"> <dt> <code class="leafygreen-ui-1l06pbn"> ObjectId.createFromHexString( &lt;hexadecimalString&gt; ) </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-method-ObjectId.createFromHexString" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-method-ObjectId.createFromHexString"> </div> </a> </dt> <dd> </dd> </dl> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> hexadecimalString </code> field specifies a string that contains a 24 character hexadecimal value. For example, <code class="leafygreen-ui-1l06pbn"> "64c13ab08edf48a008793cac" </code> . </p> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Examples <a class="headerlink leafygreen-ui-1kepx47" href="#examples" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="examples"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The following examples show how to add an object identifier to a document using <code class="leafygreen-ui-1l06pbn"> ObjectId.createFromHexString() </code> and how the object identifier appears in the output when retrieved. </p> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Create Collection Containing Document with Object Identifier <a class="headerlink leafygreen-ui-1kepx47" href="#create-collection-containing-document-with-object-identifier" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="create-collection-containing-document-with-object-identifier"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example creates a collection named <code class="leafygreen-ui-1l06pbn"> objectIdentifierValuesFromHex </code> : </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.objectIdentifierValuesFromHex.insertOne( {\n _id: 0,\n objectIdentifierValue: ObjectId.createFromHexString( \"64c13ab08edf48a008793cac\" )\n} )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1b1bvay"> <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">objectIdentifierValuesFromHex</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">objectIdentifierValue</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>.<span class="lg-highlight-title lg-highlight-function">createFromHexString</span>( <span class="lg-highlight-string">"64c13ab08edf48a008793cac"</span> )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The <code class="leafygreen-ui-1l06pbn"> objectIdentifierValue </code> field contains the object identifier created from the hexadecimal string specified in <code class="leafygreen-ui-1l06pbn"> ObjectId.createFromHexString() </code> . </p> </section> <section> <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium"> Retrieve Document from Collection with Object Identifier <a class="headerlink leafygreen-ui-1kepx47" href="#retrieve-document-from-collection-with-object-identifier" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="retrieve-document-from-collection-with-object-identifier"> </div> </a> </h3> <p class="leafygreen-ui-1kp3ins"> The following example retrieves the document: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.objectIdentifierValuesFromHex.findOne( { _id: 0 } )","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">objectIdentifierValuesFromHex</span>.<span class="lg-highlight-title lg-highlight-function">findOne</span>( <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span> } )</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> Example output: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n _id: 0,\n objectIdentifierValue: ObjectId(\"64c13ab08edf48a008793cac\")\n}","programmingLanguage":"JavaScript"} </script> <div class="css-1lju8ps"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-1jheeh3"> <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span>,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">objectIdentifierValue</span>: <span class="lg-highlight-title lg-highlight-class">ObjectId</span>(<span class="lg-highlight-string">"64c13ab08edf48a008793cac"</span>)</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre> </div> </div> </div> </section> </section> </section>
https://www.mongodb.com/docs/manual/reference/command/ping/
<section> <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium"> ping <a class="headerlink leafygreen-ui-1kepx47" href="#ping" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="ping"> </div> </a> </h1> <div class="leafygreen-ui-a5yxub"> <p class="css-1cmx2d4 ef7gu8j0"> On this page </p> <ul class="css-1qb0mst ef7gu8j1"> <li class="leafygreen-ui-1e7a0ei"> <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#definition" target="_self"> <span> Definition </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#compatibility" target="_self"> <span> Compatibility </span> </a> </li> <li class="leafygreen-ui-1jqtqlb"> <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#syntax" target="_self"> <span> Syntax </span> </a> </li> </ul> </div> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Definition <a class="headerlink leafygreen-ui-1kepx47" href="#definition" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="definition"> </div> </a> </h2> <dl class="dbcommand"> <dt> <code class="leafygreen-ui-1l06pbn"> ping </code> <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-dbcommand-dbcmd.ping" title="Permalink to this definition"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="mongodb-dbcommand-dbcmd.ping"> </div> </a> </dt> <dd> <p class="leafygreen-ui-1kp3ins"> The <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-dbcommand-dbcmd.ping" target="_self"> <span> <code class="leafygreen-ui-1l06pbn"> ping </code> </span> </a> command is a no-op used to test whether a server is responding to commands. This command will return immediately even if the server is write-locked: </p> </dd> </dl> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Compatibility <a class="headerlink leafygreen-ui-1kepx47" href="#compatibility" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="compatibility"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> This command is available in deployments hosted in the following environments: </p> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas?tck=docs_server" target="_self"> <span> MongoDB Atlas </span> </a> : The fully managed service for MongoDB deployments in the cloud </p> </li> </ul> <div class="leafygreen-ui-15mdk4" role="note"> <h2 class="leafygreen-ui-6n7b7d"> Note </h2> <div class="leafygreen-ui-9mycqc"> <p class="leafygreen-ui-1kp3ins"> This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/unsupported-commands/" target="_self"> <span> Unsupported Commands <!-- --> . </span> </a> </p> </div> </div> <ul class="leafygreen-ui-rioki0"> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-enterprise/#std-label-install-mdb-enterprise"> MongoDB Enterprise </a> : The subscription-based, self-managed version of MongoDB </p> </li> <li class="leafygreen-ui-d7p7b6"> <p class="leafygreen-ui-1kp3ins"> <a class="leafygreen-ui-tqgtui" href="/docs/manual/administration/install-community/#std-label-install-mdb-community-edition"> MongoDB Community </a> : The source-available, free-to-use, and self-managed version of MongoDB </p> </li> </ul> </section> <section> <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium"> Syntax <a class="headerlink leafygreen-ui-1kepx47" href="#syntax" title="Permalink to this heading"> <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg"> <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor"> </path> <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor"> </path> </svg> <div class="css-1btu0w3 evvkmar0" id="syntax"> </div> </a> </h2> <p class="leafygreen-ui-1kp3ins"> The command has the following syntax: </p> <script class="structured_data" type="application/ld+json"> {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.runCommand(\n {\n ping: 1\n }\n)","programmingLanguage":"JavaScript"} </script> <div class="css-16lmvu9"> <div class="leafygreen-ui-196mwvg"> <div class="leafygreen-ui-yzcs8i"> <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-title lg-highlight-function">runCommand</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx"> <span class="lg-highlight-attr">ping</span>: <span class="lg-highlight-number">1</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx"> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre> <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel"> <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0"> <div class="leafygreen-ui-xhlipt"> <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16"> <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd"> </path> </svg> </div> </button> </div> </div> </div> </div> <p class="leafygreen-ui-1kp3ins"> The value (e.g. <code class="leafygreen-ui-1l06pbn"> 1 </code> above) does not impact the behavior of the command. </p> </section> </section>