<section>
 <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium">
  Connection String Options
  <a class="headerlink leafygreen-ui-1kepx47" href="#connection-string-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="connection-string-options">
   </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="#replica-set-option" target="_self">
     <span>
      Replica Set Option
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#connection-options" target="_self">
     <span>
      Connection 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="#timeout-options" target="_self">
     <span>
      Timeout Options
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#compression-options" target="_self">
     <span>
      Compression Options
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#connection-pool-options" target="_self">
     <span>
      Connection Pool Options
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#write-concern-options" target="_self">
     <span>
      Write Concern Options
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#readconcern-options" target="_self">
     <span>
      readConcern Options
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#read-preference-options" target="_self">
     <span>
      Read Preference Options
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#authentication-options" target="_self">
     <span>
      Authentication Options
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#server-selection-and-discovery-options" target="_self">
     <span>
      Server Selection and Discovery Options
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#miscellaneous-configuration" target="_self">
     <span>
      Miscellaneous Configuration
     </span>
    </a>
   </li>
  </ul>
 </div>
 <p class="leafygreen-ui-1kp3ins">
  This page lists all connection option for both SRV connection
strings and standard connection strings.
 </p>
 <p class="leafygreen-ui-1kp3ins">
  Connection options are pairs in the following form:
  <code class="leafygreen-ui-1l06pbn">
   name=value
  </code>
  .
 </p>
 <ul class="leafygreen-ui-rioki0">
  <li class="leafygreen-ui-d7p7b6">
   <p class="leafygreen-ui-1kp3ins">
    The option
    <code class="leafygreen-ui-1l06pbn">
     name
    </code>
    is case insensitive when using a driver.
   </p>
  </li>
  <li class="leafygreen-ui-d7p7b6">
   <p class="leafygreen-ui-1kp3ins">
    The option
    <code class="leafygreen-ui-1l06pbn">
     name
    </code>
    is case insensitive 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>
   </p>
  </li>
  <li class="leafygreen-ui-d7p7b6">
   <p class="leafygreen-ui-1kp3ins">
    The
    <code class="leafygreen-ui-1l06pbn">
     value
    </code>
    is always case sensitive.
   </p>
  </li>
 </ul>
 <p class="leafygreen-ui-1kp3ins">
  Separate options with the ampersand (
  <code class="leafygreen-ui-1l06pbn">
   &amp;
  </code>
  ) character
  <code class="leafygreen-ui-1l06pbn">
   name1=value1&amp;name2=value2
  </code>
  . In the following example, a
connection includes the
  <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.replicaSet" target="_self">
   <span>
    <code class="leafygreen-ui-1l06pbn">
     replicaSet
    </code>
   </span>
  </a>
  and
  <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.connectTimeoutMS" target="_self">
   <span>
    <code class="leafygreen-ui-1l06pbn">
     connectTimeoutMS
    </code>
   </span>
  </a>
  options:
 </p>
 <script class="structured_data" type="application/ld+json">
  {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@db1.example.net:27017,db2.example.net:2500/?replicaSet=test&amp;connectTimeoutMS=300000"}
 </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">mongodb://myDatabaseUser:D1fficultP%40ssw0rd@db1.example.net:27017,db2.example.net:2500/?replicaSet=test&amp;connectTimeoutMS=300000</td></tr></tbody></table></code></pre>
    <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
     <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
      <div class="leafygreen-ui-xhlipt">
       <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
        <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 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>
    Semi-colon separator for connection string arguments
   </strong>
  </h3>
  <div class="leafygreen-ui-9mycqc">
   <p class="leafygreen-ui-1kp3ins">
    To provide backwards compatibility, drivers currently accept
semi-colons (
    <code class="leafygreen-ui-1l06pbn">
     ;
    </code>
    ) as option separators.
   </p>
  </div>
 </div>
 <span class="leafygreen-ui-1qnjd6d" id="std-label-replica-set-option">
 </span>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Replica Set Option
   <a class="headerlink leafygreen-ui-1kepx47" href="#replica-set-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="replica-set-option">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   The following connection string connects to a replica set named
   <code class="leafygreen-ui-1l06pbn">
    myRepl
   </code>
   with members running on the specified hosts. It
authenticates as user
   <code class="leafygreen-ui-1l06pbn">
    myDatabaseUser
   </code>
   with the password
   <code class="leafygreen-ui-1l06pbn">
    D1fficultP%40ssw0rd
   </code>
   :
  </p>
  <script class="structured_data" type="application/ld+json">
   {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@db0.example.com:27017,db1.example.com:27017,db2.example.com:27017/?replicaSet=myRepl","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">mongodb:/<!-- -->/my<!-- -->DatabaseUser:D1fficultP%40ssw0rd@db0.example.com:27017,db1.example.com:27017,db2.example.com:27017/?replicaSet=myRepl</td></tr></tbody></table></code></pre>
     <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
      <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
       <div class="leafygreen-ui-xhlipt">
        <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
         <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 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: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>
         Connection Option
        </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>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            replicaSet
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.replicaSet" 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-urioption-urioption.replicaSet">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Specifies the name of the
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set">
           replica set
          </a>
          , 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>
          is a member of a replica set. Set the
          <code class="leafygreen-ui-1l06pbn">
           replicaSet
          </code>
          connection option to ensure consistent behavior across drivers.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          When connecting to a replica set, provide a
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-seed-list">
           seed list
          </a>
          of
the replica set member(s) to the
          <code class="leafygreen-ui-1l06pbn">
           host[:port]
          </code>
          component of the
uri. For specific details, refer to your
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self">
           <span>
            driver
           </span>
          </a>
          documentation.
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            directConnection
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.directConnection" 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-urioption-urioption.directConnection">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Specifies whether the client connects directly to the
          <code class="leafygreen-ui-1l06pbn">
           host[:port]
          </code>
          in the
connection URI:
         </p>
         <ul class="leafygreen-ui-rioki0">
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <code class="leafygreen-ui-1l06pbn">
             true
            </code>
            : The client sends operations to only the specified host. It doesn't
attempt to discover any other members of the replica set.
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <code class="leafygreen-ui-1l06pbn">
             false
            </code>
            : The client attempts to discover all servers in the replica set,
and sends operations to the primary member. This is the default value.
           </p>
          </li>
         </ul>
        </div>
       </div>
      </td>
     </tr>
    </tbody>
   </table>
  </div>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Connection Options
   <a class="headerlink leafygreen-ui-1kepx47" href="#connection-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="connection-options">
    </div>
   </a>
  </h2>
  <span class="leafygreen-ui-1qnjd6d" id="std-label-uri-options-tls">
  </span>
  <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>
   <p class="leafygreen-ui-1kp3ins">
    The following connection string to a replica set includes
    <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.tls" target="_self">
     <span>
      <code class="leafygreen-ui-1l06pbn">
       tls=true
      </code>
     </span>
    </a>
    option. It authenticates as user
    <code class="leafygreen-ui-1l06pbn">
     myDatabaseUser
    </code>
    with the password
    <code class="leafygreen-ui-1l06pbn">
     D1fficultP%40ssw0rd
    </code>
    .
   </p>
   <script class="structured_data" type="application/ld+json">
    {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@db0.example.com,db1.example.com,db2.example.com/?replicaSet=myRepl&amp;tls=true"}
   </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">mongodb://myDatabaseUser:D1fficultP%40ssw0rd@db0.example.com,db1.example.com,db2.example.com/?replicaSet=myRepl&amp;tls=true</td></tr></tbody></table></code></pre>
      <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
       <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
        <div class="leafygreen-ui-xhlipt">
         <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
          <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.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, you can also use the equivalent
    <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.ssl" target="_self">
     <span>
      <code class="leafygreen-ui-1l06pbn">
       ssl=true
      </code>
     </span>
    </a>
    option:
   </p>
   <script class="structured_data" type="application/ld+json">
    {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@db0.example.com,db1.example.com,db2.example.com/?replicaSet=myRepl&amp;ssl=true"}
   </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">mongodb://myDatabaseUser:D1fficultP%40ssw0rd@db0.example.com,db1.example.com,db2.example.com/?replicaSet=myRepl&amp;ssl=true</td></tr></tbody></table></code></pre>
      <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
       <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
        <div class="leafygreen-ui-xhlipt">
         <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
          <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 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: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>
          Connection Option
         </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>
          <dl class="urioption">
           <dt>
            <code class="leafygreen-ui-1l06pbn">
             tls
            </code>
            <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.tls" 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-urioption-urioption.tls">
             </div>
            </a>
           </dt>
           <dd>
           </dd>
          </dl>
         </div>
        </div>
       </td>
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <p class="leafygreen-ui-1kp3ins">
           Enables or disables TLS/SSL for the connection:
          </p>
          <ul class="leafygreen-ui-rioki0">
           <li class="leafygreen-ui-d7p7b6">
            <p class="leafygreen-ui-1kp3ins">
             <code class="leafygreen-ui-1l06pbn">
              true
             </code>
             : Initiate the connection with TLS/SSL. Default for
             <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string/#std-label-connections-dns-seedlist">
              SRV Connection Format
              <!-- -->
              .
             </a>
            </p>
           </li>
           <li class="leafygreen-ui-d7p7b6">
            <p class="leafygreen-ui-1kp3ins">
             <code class="leafygreen-ui-1l06pbn">
              false
             </code>
             : Initiate the connection without TLS/SSL. Default for
             <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string/#std-label-connections-standard-connection-string-format">
              Standard Connection String Format
              <!-- -->
              .
             </a>
            </p>
           </li>
          </ul>
          <p class="leafygreen-ui-1kp3ins">
           The
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.tls" target="_self">
            <span>
             <code class="leafygreen-ui-1l06pbn">
              tls
             </code>
            </span>
           </a>
           option is equivalent to the
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.ssl" target="_self">
            <span>
             <code class="leafygreen-ui-1l06pbn">
              ssl
             </code>
            </span>
           </a>
           option.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           If 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 specifies additional
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shellmongosh-tls/" target="_self">
            <span>
             tls/ssl
            </span>
           </a>
           options from the
command-line, use the
           <code class="leafygreen-ui-1l06pbn">
            --tls
           </code>
           command-line option instead.
          </p>
         </div>
        </div>
       </td>
      </tr>
      <tr class="leafygreen-ui-15dvrnp">
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <dl class="urioption">
           <dt>
            <code class="leafygreen-ui-1l06pbn">
             ssl
            </code>
            <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.ssl" 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-urioption-urioption.ssl">
             </div>
            </a>
           </dt>
           <dd>
           </dd>
          </dl>
         </div>
        </div>
       </td>
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <p class="leafygreen-ui-1kp3ins">
           A boolean to enable or disable TLS/SSL for the connection:
          </p>
          <ul class="leafygreen-ui-rioki0">
           <li class="leafygreen-ui-d7p7b6">
            <p class="leafygreen-ui-1kp3ins">
             <code class="leafygreen-ui-1l06pbn">
              true
             </code>
             : Initiate the connection with TLS/SSL. Default for
             <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string/#std-label-connections-dns-seedlist">
              SRV Connection Format
              <!-- -->
              .
             </a>
            </p>
           </li>
           <li class="leafygreen-ui-d7p7b6">
            <p class="leafygreen-ui-1kp3ins">
             <code class="leafygreen-ui-1l06pbn">
              false
             </code>
             : Initiate the connection without TLS/SSL. Default
for
             <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string/#std-label-connections-standard-connection-string-format">
              Standard Connection String Format
              <!-- -->
              .
             </a>
            </p>
           </li>
          </ul>
          <p class="leafygreen-ui-1kp3ins">
           The
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.ssl" target="_self">
            <span>
             <code class="leafygreen-ui-1l06pbn">
              ssl
             </code>
            </span>
           </a>
           option is equivalent to the
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.tls" target="_self">
            <span>
             <code class="leafygreen-ui-1l06pbn">
              tls
             </code>
            </span>
           </a>
           option.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           If 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 specifies additional
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shellmongosh-ssl/" target="_self">
            <span>
             tls/ssl
            </span>
           </a>
           options from the
command-line, use the
           <code class="leafygreen-ui-1l06pbn">
            --ssl
           </code>
           command-line option instead.
          </p>
         </div>
        </div>
       </td>
      </tr>
      <tr class="leafygreen-ui-15dvrnp">
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <dl class="urioption">
           <dt>
            <code class="leafygreen-ui-1l06pbn">
             tlsCertificateKeyFile
            </code>
            <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.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="mongodb-urioption-urioption.tlsCertificateKeyFile">
             </div>
            </a>
           </dt>
           <dd>
           </dd>
          </dl>
         </div>
        </div>
       </td>
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <p class="leafygreen-ui-1kp3ins">
           Specifies the location of a local
           <code class="file docutils literal">
            <span class="pre">
             .pem
            </span>
           </code>
           file that
contains either the client's TLS/SSL X.509 certificate or the
client's TLS/SSL certificate and key.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           The client presents this file 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>
           /
           <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">
           <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>
           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">
           This option is not supported by all drivers. Refer to the
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self">
            <span>
             Drivers
            </span>
           </a>
           documentation.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           This connection string option is not available for the
           <code class="leafygreen-ui-1l06pbn">
            mongo
           </code>
           shell.
Use the command-line option instead.
          </p>
         </div>
        </div>
       </td>
      </tr>
      <tr class="leafygreen-ui-15dvrnp">
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <dl class="urioption">
           <dt>
            <code class="leafygreen-ui-1l06pbn">
             tlsCertificateKeyFilePassword
            </code>
            <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.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="mongodb-urioption-urioption.tlsCertificateKeyFilePassword">
             </div>
            </a>
           </dt>
           <dd>
           </dd>
          </dl>
         </div>
        </div>
       </td>
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <p class="leafygreen-ui-1kp3ins">
           Specifies the password to de-crypt the
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.tlsCertificateKeyFile" target="_self">
            <span>
             <code class="leafygreen-ui-1l06pbn">
              tlsCertificateKeyFile
             </code>
             .
            </span>
           </a>
          </p>
          <p class="leafygreen-ui-1kp3ins">
           This option is not supported by all drivers. Refer to the
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self">
            <span>
             Drivers
            </span>
           </a>
           documentation.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           This connection string option is not available for the
           <code class="leafygreen-ui-1l06pbn">
            mongo
           </code>
           shell.
Use the command-line option instead.
          </p>
         </div>
        </div>
       </td>
      </tr>
      <tr class="leafygreen-ui-15dvrnp">
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <dl class="urioption">
           <dt>
            <code class="leafygreen-ui-1l06pbn">
             tlsCAFile
            </code>
            <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.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="mongodb-urioption-urioption.tlsCAFile">
             </div>
            </a>
           </dt>
           <dd>
           </dd>
          </dl>
         </div>
        </div>
       </td>
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <p class="leafygreen-ui-1kp3ins">
           Specifies the location of a local
           <code class="file docutils literal">
            <span class="pre">
             .pem
            </span>
           </code>
           file that
contains the root certificate chain from the Certificate
Authority. This file is used to validate the certificate
presented by the
           <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>
           instance.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           This option is not supported by all drivers. Refer to the
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self">
            <span>
             Drivers
            </span>
           </a>
           documentation.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           This connection string option is not available for the
           <code class="leafygreen-ui-1l06pbn">
            mongo
           </code>
           shell.
Use the command-line option instead.
          </p>
         </div>
        </div>
       </td>
      </tr>
      <tr class="leafygreen-ui-15dvrnp">
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <dl class="urioption">
           <dt>
            <code class="leafygreen-ui-1l06pbn">
             tlsAllowInvalidCertificates
            </code>
            <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.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="mongodb-urioption-urioption.tlsAllowInvalidCertificates">
             </div>
            </a>
           </dt>
           <dd>
           </dd>
          </dl>
         </div>
        </div>
       </td>
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <p class="leafygreen-ui-1kp3ins">
           Bypasses validation of the certificates presented by the
           <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>
           instance
          </p>
          <p class="leafygreen-ui-1kp3ins">
           Set to
           <code class="leafygreen-ui-1l06pbn">
            true
           </code>
           to connect to MongoDB instances even if the
server's present invalid certificates.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           This option is not supported by all drivers. Refer to the
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self">
            <span>
             Drivers
            </span>
           </a>
           documentation.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           This connection string option is not available for the
           <code class="leafygreen-ui-1l06pbn">
            mongo
           </code>
           shell.
Use the command-line option instead.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           <strong class="css-4dei7l">
            WARNING:
           </strong>
           Disabling certificate validation creates a vulnerability.
          </p>
         </div>
        </div>
       </td>
      </tr>
      <tr class="leafygreen-ui-15dvrnp">
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <dl class="urioption">
           <dt>
            <code class="leafygreen-ui-1l06pbn">
             tlsAllowInvalidHostnames
            </code>
            <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.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="mongodb-urioption-urioption.tlsAllowInvalidHostnames">
             </div>
            </a>
           </dt>
           <dd>
           </dd>
          </dl>
         </div>
        </div>
       </td>
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <p class="leafygreen-ui-1kp3ins">
           Disables hostname validation of the certificate presented by
the
           <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>
           instance.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           Set to
           <code class="leafygreen-ui-1l06pbn">
            true
           </code>
           to connect to MongoDB instances even if the
hostname in the server certificates do not match the server's
host.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           This option is not supported by all drivers. Refer to the
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self">
            <span>
             Drivers
            </span>
           </a>
           documentation.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           This connection string option is not available for the
           <code class="leafygreen-ui-1l06pbn">
            mongo
           </code>
           shell.
Use the command-line option instead.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           <strong class="css-4dei7l">
            WARNING:
           </strong>
           Disabling certificate validation creates a vulnerability.
          </p>
         </div>
        </div>
       </td>
      </tr>
      <tr class="leafygreen-ui-15dvrnp">
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <dl class="urioption">
           <dt>
            <code class="leafygreen-ui-1l06pbn">
             tlsInsecure
            </code>
            <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.tlsInsecure" 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-urioption-urioption.tlsInsecure">
             </div>
            </a>
           </dt>
           <dd>
           </dd>
          </dl>
         </div>
        </div>
       </td>
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <p class="leafygreen-ui-1kp3ins">
           Disables various certificate validations.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           Set to
           <code class="leafygreen-ui-1l06pbn">
            true
           </code>
           to disable certificate validations. The exact
validatations disabled vary by drivers. Refer to the
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self">
            <span>
             Drivers
            </span>
           </a>
           documentation.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           This connection string option is not available for the
           <code class="leafygreen-ui-1l06pbn">
            mongo
           </code>
           shell.
Use the command-line option instead.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           <strong class="css-4dei7l">
            WARNING:
           </strong>
           Disabling certificate validation creates a vulnerability.
          </p>
         </div>
        </div>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Timeout Options
    <a class="headerlink leafygreen-ui-1kepx47" href="#timeout-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="timeout-options">
     </div>
    </a>
   </h3>
   <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>
          Connection Option
         </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>
          <dl class="urioption">
           <dt>
            <code class="leafygreen-ui-1l06pbn">
             connectTimeoutMS
            </code>
            <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.connectTimeoutMS" 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-urioption-urioption.connectTimeoutMS">
             </div>
            </a>
           </dt>
           <dd>
           </dd>
          </dl>
         </div>
        </div>
       </td>
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          The time in milliseconds to attempt a connection before timing
out. The default is 10,000 milliseconds, but specific drivers
might have a different default. For details, see the
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self">
           <span>
            driver
           </span>
          </a>
          documentation.
         </div>
        </div>
       </td>
      </tr>
      <tr class="">
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <dl class="urioption">
           <dt>
            <code class="leafygreen-ui-1l06pbn">
             socketTimeoutMS
            </code>
            <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.socketTimeoutMS" 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-urioption-urioption.socketTimeoutMS">
             </div>
            </a>
           </dt>
           <dd>
           </dd>
          </dl>
         </div>
        </div>
       </td>
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          The time in milliseconds to attempt a send or receive on a
socket before the attempt times out. The default is never to
timeout, though different drivers might vary. See the
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self">
           <span>
            driver
           </span>
          </a>
          documentation.
         </div>
        </div>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Compression Options
    <a class="headerlink leafygreen-ui-1kepx47" href="#compression-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="compression-options">
     </div>
    </a>
   </h3>
   <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>
          Connection Option
         </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>
          <dl class="urioption">
           <dt>
            <code class="leafygreen-ui-1l06pbn">
             compressors
            </code>
            <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.compressors" 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-urioption-urioption.compressors">
             </div>
            </a>
           </dt>
           <dd>
           </dd>
          </dl>
         </div>
        </div>
       </td>
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <p class="leafygreen-ui-1kp3ins">
           Comma-delimited string of compressors to enable
network compression for communication between this
client and a
           <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>
           instance.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           You can specify 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>
          <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 the client specifies the following network
compressors
           <code class="leafygreen-ui-1l06pbn">
            "zlib,snappy"
           </code>
           and the
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod">
            <code class="leafygreen-ui-1l06pbn">
             mongod
            </code>
           </a>
           specifies
           <code class="leafygreen-ui-1l06pbn">
            "snappy,zlib"
           </code>
           , messages between the client and the
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod">
            <code class="leafygreen-ui-1l06pbn">
             mongod
            </code>
           </a>
           uses
           <code class="leafygreen-ui-1l06pbn">
            zlib
           </code>
           .
          </p>
          <p class="leafygreen-ui-1kp3ins">
           Messages are compressed when both parties enable network
compression. Otherwise, messages between the parties are
uncompressed.
          </p>
          <p class="leafygreen-ui-1kp3ins">
           If the parties do not share at least one common compressor,
messages between the parties are uncompressed.
          </p>
          <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>
           supports the uri connection string
option
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.compressors" target="_self">
            <span>
             <code class="leafygreen-ui-1l06pbn">
              compressors
             </code>
             .
            </span>
           </a>
          </p>
         </div>
        </div>
       </td>
      </tr>
      <tr class="">
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <dl class="urioption">
           <dt>
            <code class="leafygreen-ui-1l06pbn">
             zlibCompressionLevel
            </code>
            <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.zlibCompressionLevel" 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-urioption-urioption.zlibCompressionLevel">
             </div>
            </a>
           </dt>
           <dd>
           </dd>
          </dl>
         </div>
        </div>
       </td>
       <td class="leafygreen-ui-1drjk7h">
        <div class="leafygreen-ui-1n4j8xf">
         <div>
          <p class="leafygreen-ui-1kp3ins">
           An integer that specifies the compression level if using
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-zlib">
            zlib
           </a>
           for
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.compressors" target="_self">
            <span>
             <code class="leafygreen-ui-1l06pbn">
              network compression
             </code>
             .
            </span>
           </a>
          </p>
          <p class="leafygreen-ui-1kp3ins">
           You can specify an integer value ranging from
           <code class="leafygreen-ui-1l06pbn">
            -1
           </code>
           to
           <code class="leafygreen-ui-1l06pbn">
            9
           </code>
           :
          </p>
          <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>
                 Value
                </div>
               </div>
              </th>
              <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
               <div class="leafygreen-ui-ui0te9">
                <div>
                 Notes
                </div>
               </div>
              </th>
             </tr>
            </thead>
            <tbody>
             <tr class="">
              <td class="leafygreen-ui-1drjk7h">
               <div class="leafygreen-ui-1n4j8xf">
                <div>
                 <code class="leafygreen-ui-1l06pbn">
                  -1
                 </code>
                </div>
               </div>
              </td>
              <td class="leafygreen-ui-1drjk7h">
               <div class="leafygreen-ui-1n4j8xf">
                <div>
                 Default compression level, usually level
                 <code class="leafygreen-ui-1l06pbn">
                  6
                 </code>
                 compression.
                </div>
               </div>
              </td>
             </tr>
             <tr class="">
              <td class="leafygreen-ui-1drjk7h">
               <div class="leafygreen-ui-1n4j8xf">
                <div>
                 <code class="leafygreen-ui-1l06pbn">
                  0
                 </code>
                </div>
               </div>
              </td>
              <td class="leafygreen-ui-1drjk7h">
               <div class="leafygreen-ui-1n4j8xf">
                <div>
                 No compression
                </div>
               </div>
              </td>
             </tr>
             <tr class="">
              <td class="leafygreen-ui-1drjk7h">
               <div class="leafygreen-ui-1n4j8xf">
                <div>
                 <code class="leafygreen-ui-1l06pbn">
                  1
                 </code>
                 -
                 <code class="leafygreen-ui-1l06pbn">
                  9
                 </code>
                </div>
               </div>
              </td>
              <td class="leafygreen-ui-1drjk7h">
               <div class="leafygreen-ui-1n4j8xf">
                <div>
                 <p class="leafygreen-ui-1kp3ins">
                  Increasing level of compression but at the cost of speed, with:
                 </p>
                 <ul class="leafygreen-ui-rioki0">
                  <li class="leafygreen-ui-d7p7b6">
                   <p class="leafygreen-ui-1kp3ins">
                    <code class="leafygreen-ui-1l06pbn">
                     1
                    </code>
                    providing the best speed but least compression, and
                   </p>
                  </li>
                  <li class="leafygreen-ui-d7p7b6">
                   <p class="leafygreen-ui-1kp3ins">
                    <code class="leafygreen-ui-1l06pbn">
                     9
                    </code>
                    providing the best compression but at the slowest speed.
                   </p>
                  </li>
                 </ul>
                </div>
               </div>
              </td>
             </tr>
            </tbody>
           </table>
          </div>
          <p class="leafygreen-ui-1kp3ins">
           Supported by
           <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>
         </div>
        </div>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
   <span class="leafygreen-ui-1qnjd6d" id="std-label-connection-pool-options">
   </span>
  </section>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Connection Pool Options
   <a class="headerlink leafygreen-ui-1kepx47" href="#connection-pool-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="connection-pool-options">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   Most drivers implement some kind of connection pool handling.
Some drivers do not support connection
pools. See your
   <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self">
    <span>
     driver
    </span>
   </a>
   documentation
for more information on the connection pooling implementation. These
options allow applications to configure the connection pool when
connecting to the MongoDB deployment.
  </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>
         Connection Option
        </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>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            maxPoolSize
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.maxPoolSize" 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-urioption-urioption.maxPoolSize">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         The maximum number of connections in the connection pool. The
default value is
         <code class="leafygreen-ui-1l06pbn">
          100
         </code>
         .
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            minPoolSize
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.minPoolSize" 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-urioption-urioption.minPoolSize">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          The minimum number of connections in the connection pool. The
default value is
          <code class="leafygreen-ui-1l06pbn">
           0
          </code>
          .
         </p>
         <p class="leafygreen-ui-1kp3ins">
          The
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.minPoolSize" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             minPoolSize
            </code>
           </span>
          </a>
          option is not supported by all
drivers. 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>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            maxConnecting
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.maxConnecting" 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-urioption-urioption.maxConnecting">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Maximum number of connections a pool may be establishing
concurrently. The default value is
          <code class="leafygreen-ui-1l06pbn">
           2
          </code>
          .
         </p>
         <p class="leafygreen-ui-1kp3ins">
          <code class="leafygreen-ui-1l06pbn">
           maxConnecting
          </code>
          is supported for all drivers
          <strong>
           except
          </strong>
          the
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/rust/current/" target="_self">
           <span>
            Rust Driver
            <!-- -->
            .
           </span>
          </a>
         </p>
         <p class="leafygreen-ui-1kp3ins">
          Raising the value of
          <code class="leafygreen-ui-1l06pbn">
           maxConnecting
          </code>
          allows the client to establish
connection to the server faster, but increases the chance of
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-connection-storm">
           connection storms
          </a>
          . If the value of
          <code class="leafygreen-ui-1l06pbn">
           maxConnecting
          </code>
          is too low, your connection pool may experience heavy
throttling and increased tail latency for clients checking out
connections.
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            maxIdleTimeMS
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.maxIdleTimeMS" 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-urioption-urioption.maxIdleTimeMS">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          The maximum number of milliseconds that a connection can remain
idle in the pool before being removed and closed.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          This option is not supported by all drivers.
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            waitQueueMultiple
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.waitQueueMultiple" 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-urioption-urioption.waitQueueMultiple">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          A number that the driver multiplies the
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.maxPoolSize" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             maxPoolSize
            </code>
           </span>
          </a>
          value to, to provide the maximum number of threads allowed to
wait for a connection to become available from the pool. For
default values, see the
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self">
           <span>
            driver
           </span>
          </a>
          documentation.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          This option is not supported by all drivers.
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            waitQueueTimeoutMS
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.waitQueueTimeoutMS" 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-urioption-urioption.waitQueueTimeoutMS">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          The maximum time in milliseconds that a thread can wait for a
connection to become available. For default values, see the
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self">
           <span>
            driver
           </span>
          </a>
          documentation.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          This option is not supported by all drivers.
         </p>
        </div>
       </div>
      </td>
     </tr>
    </tbody>
   </table>
  </div>
  <span class="leafygreen-ui-1qnjd6d" id="std-label-connections-write-concern">
  </span>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Write Concern Options
   <a class="headerlink leafygreen-ui-1kepx47" href="#write-concern-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="write-concern-options">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern">
    Write concern
   </a>
   describes the level of
acknowledgment requested from MongoDB. The write concern option is
supported by the:
  </p>
  <ul class="leafygreen-ui-rioki0">
   <li class="leafygreen-ui-d7p7b6">
    <p class="leafygreen-ui-1kp3ins">
     MongoDB drivers
    </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">
     <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongofiles/#mongodb-binary-bin.mongofiles" target="_self">
      <span>
       <code class="leafygreen-ui-1l06pbn">
        mongofiles
       </code>
      </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/database-tools/mongoimport/#mongodb-binary-bin.mongoimport" target="_self">
      <span>
       <code class="leafygreen-ui-1l06pbn">
        mongoimport
       </code>
      </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/database-tools/mongorestore/#mongodb-binary-bin.mongorestore" target="_self">
      <span>
       <code class="leafygreen-ui-1l06pbn">
        mongorestore
       </code>
      </span>
     </a>
    </p>
   </li>
  </ul>
  <p class="leafygreen-ui-1kp3ins">
   You can specify the write concern both in the connection string and
as a parameter to methods like
   <code class="leafygreen-ui-1l06pbn">
    insert
   </code>
   or
   <code class="leafygreen-ui-1l06pbn">
    update
   </code>
   . If the
write concern is specified in both places, the method parameter
overrides the connection-string setting.
  </p>
  <p class="leafygreen-ui-1kp3ins">
   MongoDB Atlas deployment connection strings use
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-">
    <code class="leafygreen-ui-1l06pbn">
     "majority"
    </code>
   </a>
   by default. If you don't specify write concern for an MongoDB Atlas
deployment, MongoDB Atlas enforces
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-">
    <code class="leafygreen-ui-1l06pbn">
     "majority"
    </code>
    .
   </a>
  </p>
  <p class="leafygreen-ui-1kp3ins">
   The following connection string to a replica set specifies
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-">
    <code class="leafygreen-ui-1l06pbn">
     "majority"
    </code>
   </a>
   write concern and a 5 second
timeout using the
   <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.wtimeoutMS" target="_self">
    <span>
     <code class="leafygreen-ui-1l06pbn">
      wtimeoutMS
     </code>
    </span>
   </a>
   write concern parameter:
  </p>
  <script class="structured_data" type="application/ld+json">
   {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@db0.example.com,db1.example.com,db2.example.com/?replicaSet=myRepl&amp;w=majority&amp;wtimeoutMS=5000"}
  </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">mongodb://myDatabaseUser:D1fficultP%40ssw0rd@db0.example.com,db1.example.com,db2.example.com/?replicaSet=myRepl&amp;w=majority&amp;wtimeoutMS=5000</td></tr></tbody></table></code></pre>
     <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
      <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
       <div class="leafygreen-ui-xhlipt">
        <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
         <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 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: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>
         Connection Option
        </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>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            w
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.w" 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-urioption-urioption.w">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Corresponds to the write concern
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-w">
           <code class="leafygreen-ui-1l06pbn">
            w
           </code>
           Option
          </a>
          . The
          <code class="leafygreen-ui-1l06pbn">
           w
          </code>
          option
requests acknowledgment that the write operation has propagated
to a specified number of
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod">
           <code class="leafygreen-ui-1l06pbn">
            mongod
           </code>
          </a>
          instances or 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 with specified tags.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          You can specify a
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-number-">
           <code class="leafygreen-ui-1l06pbn">
            number
           </code>
          </a>
          , the
string
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-majority-">
           <code class="leafygreen-ui-1l06pbn">
            majority
           </code>
          </a>
          , or a
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#mongodb-writeconcern-writeconcern.-custom-write-concern-name-">
           <code class="leafygreen-ui-1l06pbn">
            tag set
           </code>
           .
          </a>
         </p>
         <p class="leafygreen-ui-1kp3ins">
          For details, see
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-w">
           <code class="leafygreen-ui-1l06pbn">
            w
           </code>
           Option
           <!-- -->
           .
          </a>
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            wtimeoutMS
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.wtimeoutMS" 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-urioption-urioption.wtimeoutMS">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Corresponds to the write concern
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-wtimeout">
           <code class="leafygreen-ui-1l06pbn">
            wtimeout
           </code>
          </a>
          .
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.wtimeoutMS" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             wtimeoutMS
            </code>
           </span>
          </a>
          specifies a time limit, in milliseconds,
for the write concern.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          When
          <code class="leafygreen-ui-1l06pbn">
           wtimeoutMS
          </code>
          is
          <code class="leafygreen-ui-1l06pbn">
           0
          </code>
          , write operations will never time
out. For more information, see
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-wtimeout">
           <code class="leafygreen-ui-1l06pbn">
            wtimeout
           </code>
           .
          </a>
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            journal
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.journal" 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-urioption-urioption.journal">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Corresponds to the write concern
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-j">
           <code class="leafygreen-ui-1l06pbn">
            j
           </code>
           Option
          </a>
          option. The
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.journal" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             journal
            </code>
           </span>
          </a>
          option requests acknowledgment from
MongoDB that the write operation has been written to the
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/journaling/#std-label-journaling-internals">
           journal
          </a>
          . For details, see
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-wc-j">
           <code class="leafygreen-ui-1l06pbn">
            j
           </code>
           Option
           <!-- -->
           .
          </a>
         </p>
         <p class="leafygreen-ui-1kp3ins">
          If you set
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.journal" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             journal
            </code>
           </span>
          </a>
          to
          <code class="leafygreen-ui-1l06pbn">
           true
          </code>
          , and specify a
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.w" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             w
            </code>
           </span>
          </a>
          value less than 1,
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.journal" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             journal
            </code>
           </span>
          </a>
          prevails.
         </p>
        </div>
       </div>
      </td>
     </tr>
    </tbody>
   </table>
  </div>
  <p class="leafygreen-ui-1kp3ins">
   For more information, see
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/#std-label-write-concern">
    Write Concern
    <!-- -->
    .
   </a>
  </p>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   readConcern Options
   <a class="headerlink leafygreen-ui-1kepx47" href="#readconcern-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="readconcern-options">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   For the WiredTiger storage engine, MongoDB introduces the
   <code class="leafygreen-ui-1l06pbn">
    readConcern
   </code>
   option for replica sets and replica set shards.
  </p>
  <p class="leafygreen-ui-1kp3ins">
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern/">
    Read Concern
   </a>
   allows clients to choose a level of
isolation for their reads from replica sets.
  </p>
  <p class="leafygreen-ui-1kp3ins">
   The following connection string to a replica set specifies
   <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.readConcernLevel" target="_self">
    <span>
     <code class="leafygreen-ui-1l06pbn">
      readConcernLevel=majority
     </code>
     :
    </span>
   </a>
  </p>
  <script class="structured_data" type="application/ld+json">
   {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@db0.example.com,db1.example.com,db2.example.com/?replicaSet=myRepl&amp;readConcernLevel=majority"}
  </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">mongodb://myDatabaseUser:D1fficultP%40ssw0rd@db0.example.com,db1.example.com,db2.example.com/?replicaSet=myRepl&amp;readConcernLevel=majority</td></tr></tbody></table></code></pre>
     <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
      <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
       <div class="leafygreen-ui-xhlipt">
        <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
         <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 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: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>
         Connection Option
        </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>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            readConcernLevel
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.readConcernLevel" 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-urioption-urioption.readConcernLevel">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          The level of isolation. Can accept one of the following values:
         </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/read-concern-local/#mongodb-readconcern-readconcern.-local-">
             <code class="leafygreen-ui-1l06pbn">
              local
             </code>
            </a>
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <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>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-linearizable/#mongodb-readconcern-readconcern.-linearizable-">
             <code class="leafygreen-ui-1l06pbn">
              linearizable
             </code>
            </a>
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-available/#mongodb-readconcern-readconcern.-available-">
             <code class="leafygreen-ui-1l06pbn">
              available
             </code>
            </a>
           </p>
          </li>
         </ul>
         <p class="leafygreen-ui-1kp3ins">
          This connection string option is not available for
          <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>
          . Specify the read concern as an
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern/#std-label-read-concern-operations">
           option to the specific operation
           <!-- -->
           .
          </a>
         </p>
        </div>
       </div>
      </td>
     </tr>
    </tbody>
   </table>
  </div>
  <p class="leafygreen-ui-1kp3ins">
   For more information, see
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern/">
    Read Concern
    <!-- -->
    .
   </a>
  </p>
  <span class="leafygreen-ui-1qnjd6d" id="std-label-connections-read-preference">
  </span>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Read Preference Options
   <a class="headerlink leafygreen-ui-1kepx47" href="#read-preference-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="read-preference-options">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/#std-label-read-preference">
    Read preferences
   </a>
   describe the
behavior of read operations with regards to
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set">
    replica sets
   </a>
   . These parameters allow you to specify read preferences
on a per-connection basis in the connection string.
  </p>
  <p class="leafygreen-ui-1kp3ins">
   For example:
  </p>
  <ul class="leafygreen-ui-rioki0">
   <li class="leafygreen-ui-d7p7b6">
    <p class="leafygreen-ui-1kp3ins">
     The following connection string to a replica set specifies
     <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/#mongodb-readmode-secondary">
      <code class="leafygreen-ui-1l06pbn">
       secondary
      </code>
     </a>
     read preference mode and a
     <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.maxStalenessSeconds" target="_self">
      <span>
       <code class="leafygreen-ui-1l06pbn">
        maxStalenessSeconds
       </code>
      </span>
     </a>
     value of 120 seconds:
    </p>
    <script class="structured_data" type="application/ld+json">
     {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@db0.example.com,db1.example.com,db2.example.com/?replicaSet=myRepl&amp;readPreference=secondary&amp;maxStalenessSeconds=120"}
    </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">mongodb://myDatabaseUser:D1fficultP%40ssw0rd@db0.example.com,db1.example.com,db2.example.com/?replicaSet=myRepl&amp;readPreference=secondary&amp;maxStalenessSeconds=120</td></tr></tbody></table></code></pre>
       <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
        <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
         <div class="leafygreen-ui-xhlipt">
          <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
           <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.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 connection string to a sharded cluster specifies
     <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/#mongodb-readmode-secondary">
      <code class="leafygreen-ui-1l06pbn">
       secondary
      </code>
     </a>
     read preference mode and a
     <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.maxStalenessSeconds" target="_self">
      <span>
       <code class="leafygreen-ui-1l06pbn">
        maxStalenessSeconds
       </code>
      </span>
     </a>
     value of 120 seconds:
    </p>
    <script class="structured_data" type="application/ld+json">
     {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@mongos1.example.com,mongos2.example.com/?readPreference=secondary&amp;maxStalenessSeconds=120"}
    </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">mongodb://myDatabaseUser:D1fficultP%40ssw0rd@mongos1.example.com,mongos2.example.com/?readPreference=secondary&amp;maxStalenessSeconds=120</td></tr></tbody></table></code></pre>
       <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
        <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
         <div class="leafygreen-ui-xhlipt">
          <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
           <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.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 connection string to a sharded cluster specifies
     <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/#mongodb-readmode-secondary">
      <code class="leafygreen-ui-1l06pbn">
       secondary
      </code>
     </a>
     read preference mode as well as three
     <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.readPreferenceTags" target="_self">
      <span>
       <code class="leafygreen-ui-1l06pbn">
        readPreferenceTags
       </code>
       :
      </span>
     </a>
    </p>
    <script class="structured_data" type="application/ld+json">
     {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@mongos1.example.com,mongos2.example.com/?readPreference=secondary&amp;readPreferenceTags=dc:ny,rack:r1&amp;readPreferenceTags=dc:ny&amp;readPreferenceTags="}
    </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">mongodb://myDatabaseUser:D1fficultP%40ssw0rd@mongos1.example.com,mongos2.example.com/?readPreference=secondary&amp;readPreferenceTags=dc:ny,rack:r1&amp;readPreferenceTags=dc:ny&amp;readPreferenceTags=</td></tr></tbody></table></code></pre>
       <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
        <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
         <div class="leafygreen-ui-xhlipt">
          <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
           <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.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>
  <p class="leafygreen-ui-1kp3ins">
   Order matters when using multiple
   <code class="leafygreen-ui-1l06pbn">
    readPreferenceTags
   </code>
   . The
   <code class="leafygreen-ui-1l06pbn">
    readPreferenceTags
   </code>
   are tried in order until a match is found. Once
found, that specification is used to find all eligible matching
members and any remaining
   <code class="leafygreen-ui-1l06pbn">
    readPreferenceTags
   </code>
   are ignored.
For details, see
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference-tags/#std-label-read-preference-tag-order-matching">
    Order of Tag Matching
    <!-- -->
    .
   </a>
  </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>
         Connection Option
        </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>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            readPreference
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.readPreference" 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-urioption-urioption.readPreference">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Specifies the
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/#std-label-read-preference">
           read preferences
          </a>
          for this connection. Possible values are:
         </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/read-preference/#mongodb-readmode-primary">
             <code class="leafygreen-ui-1l06pbn">
              primary
             </code>
            </a>
            (
            <em>
             Default
            </em>
            )
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/#mongodb-readmode-primaryPreferred">
             <code class="leafygreen-ui-1l06pbn">
              primaryPreferred
             </code>
            </a>
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/#mongodb-readmode-secondary">
             <code class="leafygreen-ui-1l06pbn">
              secondary
             </code>
            </a>
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/#mongodb-readmode-secondaryPreferred">
             <code class="leafygreen-ui-1l06pbn">
              secondaryPreferred
             </code>
            </a>
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/#mongodb-readmode-nearest">
             <code class="leafygreen-ui-1l06pbn">
              nearest
             </code>
            </a>
           </p>
          </li>
         </ul>
         <p class="leafygreen-ui-1kp3ins">
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions/#std-label-transactions">
           Distributed transactions
          </a>
          that contain
read operations must use read preference
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/#mongodb-readmode-primary">
           <code class="leafygreen-ui-1l06pbn">
            primary
           </code>
          </a>
          . All
operations in a given transaction must route to the same member.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          This connection string option is not available for the
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
           <code class="leafygreen-ui-1l06pbn">
            mongo
           </code>
          </a>
          shell. See
          <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>
          and
          <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>
          instead.
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            maxStalenessSeconds
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.maxStalenessSeconds" 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-urioption-urioption.maxStalenessSeconds">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Specifies, in seconds, how stale a secondary can be before the client
stops using it for read operations. For details, see
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference-staleness/#std-label-replica-set-read-preference-max-staleness">
           Read Preference
           <code class="leafygreen-ui-1l06pbn">
            maxStalenessSeconds
           </code>
           .
          </a>
         </p>
         <p class="leafygreen-ui-1kp3ins">
          By default, there is no maximum staleness and clients will not consider a
secondary's lag when choosing where to direct a read operation.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          The minimum
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.maxStalenessSeconds" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             maxStalenessSeconds
            </code>
           </span>
          </a>
          value is 90
seconds. Specifying a value between 0 and 90 seconds will produce
an error. MongoDB drivers treat a
          <code class="leafygreen-ui-1l06pbn">
           maxStalenessSeconds
          </code>
          value
of
          <code class="leafygreen-ui-1l06pbn">
           -1
          </code>
          as "no max staleness", the same as if
          <code class="leafygreen-ui-1l06pbn">
           maxStalenessSeconds
          </code>
          is omitted.
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            readPreferenceTags
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.readPreferenceTags" 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-urioption-urioption.readPreferenceTags">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Specifies the
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference-tags/#std-label-replica-set-read-preference-tag-sets">
           tags document
          </a>
          as a comma-separated
list of colon-separated key-value pairs. For example,
         </p>
         <ul class="leafygreen-ui-rioki0">
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            To specify the tags document
            <code class="leafygreen-ui-1l06pbn">
             { "dc": "ny", "rack": "r1" }
            </code>
            ,
use
            <code class="leafygreen-ui-1l06pbn">
             readPreferenceTags=dc:ny,rack:r1
            </code>
            in the connection
string.
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            To specify an empty tags document
            <code class="leafygreen-ui-1l06pbn">
             { }
            </code>
            , use
            <code class="leafygreen-ui-1l06pbn">
             readPreferenceTags=
            </code>
            without setting the value.
           </p>
          </li>
         </ul>
         <p class="leafygreen-ui-1kp3ins">
          To specify a
          <em>
           list
          </em>
          of tag documents, use multiple
          <code class="leafygreen-ui-1l06pbn">
           readPreferenceTags
          </code>
          . For example,
          <code class="leafygreen-ui-1l06pbn">
           readPreferenceTags=dc:ny,rack:r1&amp;readPreferenceTags=
          </code>
          .
         </p>
         <p class="leafygreen-ui-1kp3ins">
          Order matters when using multiple
          <code class="leafygreen-ui-1l06pbn">
           readPreferenceTags
          </code>
          . The
          <code class="leafygreen-ui-1l06pbn">
           readPreferenceTags
          </code>
          are tried in order until a match is
found. For details, see
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference-tags/#std-label-read-preference-tag-order-matching">
           Order of Tag Matching
           <!-- -->
           .
          </a>
         </p>
         <p class="leafygreen-ui-1kp3ins">
          This connection string option is not available for the
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
           <code class="leafygreen-ui-1l06pbn">
            mongo
           </code>
          </a>
          shell. See
          <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>
          and
          <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>
          instead.
         </p>
        </div>
       </div>
      </td>
     </tr>
    </tbody>
   </table>
  </div>
  <p class="leafygreen-ui-1kp3ins">
   For more information, see
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/#std-label-read-preference">
    Read preferences
    <!-- -->
    .
   </a>
  </p>
  <span class="leafygreen-ui-1qnjd6d" id="std-label-connection-string-auth-options">
  </span>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Authentication Options
   <a class="headerlink leafygreen-ui-1kepx47" href="#authentication-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="authentication-options">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   The following connection string to a replica set specifies the
   <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.authSource" target="_self">
    <span>
     <code class="leafygreen-ui-1l06pbn">
      authSource
     </code>
    </span>
   </a>
   to the
   <code class="leafygreen-ui-1l06pbn">
    admin
   </code>
   database. That is, the user
credentials are authenticated against 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":"mongodb://myDatabaseUser:D1fficultP%40ssw0rd@mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?replicaSet=myRepl&amp;authSource=admin","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">mongodb:/<!-- -->/my<!-- -->DatabaseUser:D1fficultP%40ssw0rd@mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?replicaSet=myRepl&amp;authSource=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 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 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>
         Connection Option
        </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>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            authSource
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.authSource" 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-urioption-urioption.authSource">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Specify the database name associated with the user's
credentials. If
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.authSource" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             authSource
            </code>
           </span>
          </a>
          is unspecified,
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.authSource" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             authSource
            </code>
           </span>
          </a>
          defaults to the
          <code class="leafygreen-ui-1l06pbn">
           defaultauthdb
          </code>
          specified in the connection string. If
          <code class="leafygreen-ui-1l06pbn">
           defaultauthdb
          </code>
          is
unspecified, then
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.authSource" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             authSource
            </code>
           </span>
          </a>
          defaults to
          <code class="leafygreen-ui-1l06pbn">
           admin
          </code>
          .
         </p>
         <p class="leafygreen-ui-1kp3ins">
          The
          <code class="leafygreen-ui-1l06pbn">
           PLAIN
          </code>
          (LDAP),
          <code class="leafygreen-ui-1l06pbn">
           GSSAPI
          </code>
          (Kerberos), and
          <code class="leafygreen-ui-1l06pbn">
           MONGODB-AWS
          </code>
          (IAM) authentication mechanisms require that
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.authSource" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             authSource
            </code>
           </span>
          </a>
          be set to
          <code class="leafygreen-ui-1l06pbn">
           $external
          </code>
          , as these
mechanisms delegate credential storage to external services.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          MongoDB will ignore
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.authSource" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             authSource
            </code>
           </span>
          </a>
          values if no username
is provided, either in the connection string or via the
          <code class="leafygreen-ui-1l06pbn">
           --username
          </code>
          parameter.
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            authMechanism
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.authMechanism" 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-urioption-urioption.authMechanism">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
         <p class="leafygreen-ui-1kp3ins">
          Default: SCRAM-SHA-256
         </p>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Specify the authentication mechanism that MongoDB uses to
authenticate the connection. If you don't specify an
          <code class="leafygreen-ui-1l06pbn">
           authMechanism
          </code>
          but provide user credentials, MongoDB attempts
to use SCRAM-SHA-256. If this fails, it falls back to
SCRAM-SHA-1.
         </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/security-scram/#std-label-authentication-scram-sha-1">
             SCRAM-SHA-1
            </a>
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-scram/#std-label-authentication-scram-sha-256">
             SCRAM-SHA-256
            </a>
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/security-x.509/#std-label-security-auth-x509">
             MONGODB-X509
            </a>
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <code class="leafygreen-ui-1l06pbn">
             MONGODB-AWS
            </code>
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-security-auth-kerberos">
             GSSAPI
            </a>
            (Kerberos)
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-security-auth-ldap">
             PLAIN
            </a>
            (LDAP SASL)
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <code class="leafygreen-ui-1l06pbn">
             MONGODB-OIDC
            </code>
            (OpenID Connect OIDC), you must also set the
            <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.authMechanismProperties" target="_self">
             <span>
              <code class="leafygreen-ui-1l06pbn">
               authMechanismProperties
              </code>
             </span>
            </a>
            <code class="leafygreen-ui-1l06pbn">
             ENVIRONMENT
            </code>
            variable
           </p>
          </li>
         </ul>
         <p class="leafygreen-ui-1kp3ins">
          Only MongoDB Enterprise
          <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 provide
          <code class="leafygreen-ui-1l06pbn">
           GSSAPI
          </code>
          (Kerberos) and
          <code class="leafygreen-ui-1l06pbn">
           PLAIN
          </code>
          (LDAP) mechanisms.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          To use
          <code class="leafygreen-ui-1l06pbn">
           MONGODB-X509
          </code>
          , you must have TLS/SSL Enabled.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          To use
          <code class="leafygreen-ui-1l06pbn">
           MONGODB-AWS
          </code>
          , you must be connecting 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>
          (an AWS access key ID and a secret access key, and
optionally 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>
          ).
The
          <code class="leafygreen-ui-1l06pbn">
           MONGODB-AWS
          </code>
          authentication mechanism requires that the
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.authSource" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             authSource
            </code>
           </span>
          </a>
          be set to
          <code class="leafygreen-ui-1l06pbn">
           $external
          </code>
          .
         </p>
         <p class="leafygreen-ui-1kp3ins">
          When using
          <code class="leafygreen-ui-1l06pbn">
           MONGODB-AWS
          </code>
          , provide your AWS access key ID as the
username and the secret access key as the password. 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="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.authMechanismProperties" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             authMechanismProperties
            </code>
           </span>
          </a>
          value.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          If the AWS access key ID, the secret access key, or the session token
include 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>
         <p class="leafygreen-ui-1kp3ins">
          Alternatively, if the AWS access key ID, secret access key, or
session token are defined on your platform using their respective
          <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>
          will use these environment
variable values to authenticate; you do not need to specify them
in the connection string.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          See
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string-examples/#std-label-connections-string-example-mongodb-aws">
           Connect to an Atlas Cluster
          </a>
          for example usage of
the
          <code class="leafygreen-ui-1l06pbn">
           MONGODB-AWS
          </code>
          authentication mechanism using both a
connection string and the environment variables method.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          See
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/">
           Authentication on Self-Managed Deployments
          </a>
          for more information about the
authentication system in MongoDB. Also consider
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/tutorial/configure-x509-client-authentication/">
           Use x.509 Certificates to Authenticate Clients on Self-Managed Deployments
          </a>
          for more
information on x509 authentication.
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            authMechanismProperties
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.authMechanismProperties" 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-urioption-urioption.authMechanismProperties">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Specify properties for the specified
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.authMechanism" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             authMechanism
            </code>
           </span>
          </a>
          as a comma-separated list of colon-separated key-value pairs.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          Possible key-value pairs are:
         </p>
         <dl>
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            SERVICE_NAME:&lt;string&gt;
           </code>
          </dt>
          <dd class="css-1ufxuu7">
           <p class="leafygreen-ui-1kp3ins">
            Set the Kerberos service name when connecting to Kerberized
MongoDB instances. This value must match the service name set
on MongoDB instances to which you are connecting. Only valid
when using the
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-security-auth-kerberos">
             GSSAPI
            </a>
            authentication mechanism.
           </p>
           <p class="leafygreen-ui-1kp3ins">
            <code class="leafygreen-ui-1l06pbn">
             SERVICE_NAME
            </code>
            defaults to
            <code class="leafygreen-ui-1l06pbn">
             mongodb
            </code>
            for all clients and
MongoDB instances. If you change the
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.saslServiceName">
             <code class="leafygreen-ui-1l06pbn">
              saslServiceName
             </code>
            </a>
            setting on a MongoDB instance, you
must set
            <code class="leafygreen-ui-1l06pbn">
             SERVICE_NAME
            </code>
            to match that setting. Only valid
when using the
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-security-auth-kerberos">
             GSSAPI
            </a>
            authentication mechanism.
           </p>
          </dd>
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            CANONICALIZE_HOST_NAME:true|false
           </code>
          </dt>
          <dd class="css-1ufxuu7">
           Canonicalize the hostname of the client host machine when
connecting to the Kerberos server. This may be required when
hosts report different hostnames than what is in the Kerberos
database. Defaults to
           <code class="leafygreen-ui-1l06pbn">
            false
           </code>
           . Only valid when using the
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-security-auth-kerberos">
            GSSAPI
           </a>
           authentication
mechanism.
          </dd>
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            SERVICE_REALM:&lt;string&gt;
           </code>
          </dt>
          <dd class="css-1ufxuu7">
           Set the Kerberos realm for the MongoDB service. This may be
necessary to support cross-realm authentication where the user
exists in one realm and the service in another. Only valid when
using the
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/authentication/#std-label-security-auth-kerberos">
            GSSAPI
           </a>
           authentication
mechanism.
          </dd>
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            AWS_SESSION_TOKEN:&lt;security_token&gt;
           </code>
          </dt>
          <dd class="css-1ufxuu7">
           Set the AWS session token for authentication with temporary
credentials when using an
           <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html" rel="noopener noreferrer">
            <span>
             AssumeRole
            </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>
           request, or when working with AWS resources that specify this
value such as Lambda. Only valid when using the
           <code class="leafygreen-ui-1l06pbn">
            MONGODB-AWS
           </code>
           authentication mechanism. You must have an AWS access key ID
and a secret access key as well. See
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/connection-string-examples/#std-label-connections-string-example-mongodb-aws">
            Connect to an Atlas Cluster
           </a>
           for example usage.
          </dd>
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            ENVIRONMENT:&lt;string&gt;
           </code>
          </dt>
          <dd class="css-1ufxuu7">
           <p class="leafygreen-ui-1kp3ins">
            Set the OpenID Connect (OIDC) environment. For:
           </p>
           <ul class="leafygreen-ui-rioki0">
            <li class="leafygreen-ui-d7p7b6">
             <p class="leafygreen-ui-1kp3ins">
              Microsoft Azure, set
              <code class="leafygreen-ui-1l06pbn">
               ENVIRONMENT:azure
              </code>
             </p>
            </li>
            <li class="leafygreen-ui-d7p7b6">
             <p class="leafygreen-ui-1kp3ins">
              Google Cloud Platform, set
              <code class="leafygreen-ui-1l06pbn">
               ENVIRONMENT:gcp
              </code>
             </p>
            </li>
           </ul>
           <p class="leafygreen-ui-1kp3ins">
            You must also set
            <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.authMechanism" target="_self">
             <span>
              <code class="leafygreen-ui-1l06pbn">
               authMechanism
              </code>
             </span>
            </a>
            to
            <code class="leafygreen-ui-1l06pbn">
             MONGODB-OIDC
            </code>
            .
           </p>
          </dd>
         </dl>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            gssapiServiceName
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.gssapiServiceName" 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-urioption-urioption.gssapiServiceName">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Set the Kerberos service name when connecting to Kerberized
MongoDB instances. This value must match the service name set on
MongoDB instances to which you are connecting.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.gssapiServiceName" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             gssapiServiceName
            </code>
           </span>
          </a>
          defaults to
          <code class="leafygreen-ui-1l06pbn">
           mongodb
          </code>
          for all
clients and MongoDB instances. If you change
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/parameters/#mongodb-parameter-param.saslServiceName">
           <code class="leafygreen-ui-1l06pbn">
            saslServiceName
           </code>
          </a>
          setting on a MongoDB instance, you
must set
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.gssapiServiceName" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             gssapiServiceName
            </code>
           </span>
          </a>
          to match that setting.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.gssapiServiceName" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             gssapiServiceName
            </code>
           </span>
          </a>
          is a deprecated aliases for
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.authMechanismProperties" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             authMechanismProperties=SERVICE_NAME:mongodb
            </code>
           </span>
          </a>
          . For more information on which
options your driver supports and their relative priority to each
other, reference the documentation for your preferred driver
version.
         </p>
        </div>
       </div>
      </td>
     </tr>
    </tbody>
   </table>
  </div>
  <span class="leafygreen-ui-1qnjd6d" id="std-label-selection-discovery-options">
  </span>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Server Selection and Discovery Options
   <a class="headerlink leafygreen-ui-1kepx47" href="#server-selection-and-discovery-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="server-selection-and-discovery-options">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   MongoDB provides the following options to configure how MongoDB drivers
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 select a server to which to direct read
or write operations.
  </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>
         Connection Option
        </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>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            localThresholdMS
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.localThresholdMS" 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-urioption-urioption.localThresholdMS">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          The size (in milliseconds) of the latency window for selecting
among multiple suitable MongoDB instances.
          <em>
           Default
          </em>
          : 15
milliseconds.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          All drivers use
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.localThresholdMS" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             localThresholdMS
            </code>
           </span>
          </a>
          . Use the
          <code class="leafygreen-ui-1l06pbn">
           localThreshold
          </code>
          alias when specifying the latency window size
to
          <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>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            serverSelectionTimeoutMS
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.serverSelectionTimeoutMS" 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-urioption-urioption.serverSelectionTimeoutMS">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         Specifies how long (in milliseconds) to block for server
selection before throwing an exception.
         <em>
          Default
         </em>
         : 30,000
milliseconds.
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            serverSelectionTryOnce
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.serverSelectionTryOnce" 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-urioption-urioption.serverSelectionTryOnce">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          <strong>
           Single-threaded drivers only
          </strong>
          . When
          <code class="leafygreen-ui-1l06pbn">
           true
          </code>
          , instructs the
driver to scan the MongoDB deployment exactly once after server
selection fails and then either select a server or raise an
error. When
          <code class="leafygreen-ui-1l06pbn">
           false
          </code>
          , the driver blocks and searches for a
server up to the
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.serverSelectionTimeoutMS" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             serverSelectionTimeoutMS
            </code>
           </span>
          </a>
          value.
          <em>
           Default
          </em>
          :
          <code class="leafygreen-ui-1l06pbn">
           true
          </code>
          .
         </p>
         <p class="leafygreen-ui-1kp3ins">
          Multi-threaded drivers and
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos">
           <code class="leafygreen-ui-1l06pbn">
            mongos
           </code>
          </a>
          do not support
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.serverSelectionTryOnce" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             serverSelectionTryOnce
            </code>
            .
           </span>
          </a>
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            heartbeatFrequencyMS
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.heartbeatFrequencyMS" 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-urioption-urioption.heartbeatFrequencyMS">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.heartbeatFrequencyMS" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             heartbeatFrequencyMS
            </code>
           </span>
          </a>
          controls when the driver
checks the state of the MongoDB deployment. Specify the interval
(in milliseconds) between checks, counted from the end of the
previous check until the beginning of the next one.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          <em>
           Default
          </em>
          :
         </p>
         <ul class="leafygreen-ui-rioki0">
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            Single-threaded drivers: 60 seconds.
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            Multi-threaded drivers: 10 seconds.
           </p>
          </li>
         </ul>
         <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>
          does not support changing the frequency of
the heartbeat checks.
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            socketCheckIntervalMS
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.socketCheckIntervalMS" 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-urioption-urioption.socketCheckIntervalMS">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          <strong>
           Single-threaded clients only
          </strong>
          . Controls how often the client checks the
state of the TCP connection to the MongoDB deployment. If you specify a lower
value, the client detects network issues faster but uses more CPU.
          <em>
           Default
          </em>
          : 5 seconds.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          This option is not supported by all drivers. Refer to 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>
      </td>
     </tr>
    </tbody>
   </table>
  </div>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Miscellaneous Configuration
   <a class="headerlink leafygreen-ui-1kepx47" href="#miscellaneous-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="miscellaneous-configuration">
    </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>
         Connection Option
        </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>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            appName
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.appName" 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-urioption-urioption.appName">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Specify a custom app name. The app name appears in:
         </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/#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>
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/log-messages/#std-label-log-messages-ref">
             logs
            </a>
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            the
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/currentOp/#mongodb-data-currentOp.appName">
             <code class="leafygreen-ui-1l06pbn">
              currentOp.appName
             </code>
            </a>
            field in 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/method/db.currentOp/#mongodb-method-db.currentOp">
             <code class="leafygreen-ui-1l06pbn">
              db.currentOp()
             </code>
            </a>
            method output
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            the
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/database-profiler/#mongodb-data-system.profile.appName">
             <code class="leafygreen-ui-1l06pbn">
              system.profile.appName
             </code>
            </a>
            field in the
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/database-profiler/#std-label-profiler">
             database profiler
            </a>
            output
           </p>
          </li>
         </ul>
         <p class="leafygreen-ui-1kp3ins">
          The
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.appName" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             appName
            </code>
           </span>
          </a>
          connection option is available 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="https://www.mongodb.com/docs/drivers/" target="_self">
             <span>
              MongoDB Drivers
             </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/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self">
             <span>
              <code class="leafygreen-ui-1l06pbn">
               mongosh
              </code>
             </span>
            </a>
            starting in
            <code class="leafygreen-ui-1l06pbn">
             mongosh
            </code>
            1.1.9
           </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/compass/current/" target="_self">
             <span>
              MongoDB Compass
             </span>
            </a>
            starting in Compass 1.28.4
           </p>
          </li>
         </ul>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            retryReads
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.retryReads" 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-urioption-urioption.retryReads">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Enables
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/retryable-reads/#std-label-retryable-reads">
           retryable reads
           <!-- -->
           .
          </a>
         </p>
         <p class="leafygreen-ui-1kp3ins">
          Possible values are:
         </p>
         <ul class="leafygreen-ui-rioki0">
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <code class="leafygreen-ui-1l06pbn">
             true
            </code>
            . Enables retryable reads for the connection.
           </p>
           <p class="leafygreen-ui-1kp3ins">
            Official MongoDB drivers default to
            <code class="leafygreen-ui-1l06pbn">
             true
            </code>
            .
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <code class="leafygreen-ui-1l06pbn">
             false
            </code>
            . Disables retryable reads for the connection.
           </p>
          </li>
         </ul>
         <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>
          does not support retryable reads.
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            retryWrites
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.retryWrites" 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-urioption-urioption.retryWrites">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Enable
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/retryable-writes/#std-label-retryable-writes">
           retryable writes
           <!-- -->
           .
          </a>
         </p>
         <p class="leafygreen-ui-1kp3ins">
          Possible values are:
         </p>
         <ul class="leafygreen-ui-rioki0">
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <code class="leafygreen-ui-1l06pbn">
             true
            </code>
            . Enables retryable writes for the connection.
           </p>
           <p class="leafygreen-ui-1kp3ins">
            Official MongoDB drivers default to
            <code class="leafygreen-ui-1l06pbn">
             true
            </code>
            .
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            <code class="leafygreen-ui-1l06pbn">
             false
            </code>
            . Disables retryable writes for the connection.
           </p>
          </li>
         </ul>
         <p class="leafygreen-ui-1kp3ins">
          MongoDB drivers retry
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions-in-applications/#std-label-transactions-retry">
           transaction commit and abort operations
          </a>
          regardless of the value of
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.retryWrites" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             retryWrites
            </code>
           </span>
          </a>
          . For more
information on transaction retryability, see
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/transactions-in-applications/#std-label-transactions-retry">
           Transaction Error Handling
           <!-- -->
           .
          </a>
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            uuidRepresentation
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.uuidRepresentation" 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-urioption-urioption.uuidRepresentation">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Possible values are:
         </p>
         <dl>
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            standard
           </code>
          </dt>
          <dd class="css-1ufxuu7">
           The standard binary representation.
          </dd>
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            csharpLegacy
           </code>
          </dt>
          <dd class="css-1ufxuu7">
           The default representation for the C# driver.
          </dd>
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            javaLegacy
           </code>
          </dt>
          <dd class="css-1ufxuu7">
           The default representation for the Java driver.
          </dd>
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            pythonLegacy
           </code>
          </dt>
          <dd class="css-1ufxuu7">
           The default representation for the Python driver.
          </dd>
         </dl>
         <p class="leafygreen-ui-1kp3ins">
          For the default, see the
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/drivers/" target="_self">
           <span>
            Drivers
           </span>
          </a>
          documentation for your driver.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          Not all drivers support the
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.uuidRepresentation" target="_self">
           <span>
            <code class="leafygreen-ui-1l06pbn">
             uuidRepresentation
            </code>
           </span>
          </a>
          option. 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>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            loadBalanced
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.loadBalanced" 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-urioption-urioption.loadBalanced">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Specifies whether the client is connecting to a load balancer. This option is
          <code class="leafygreen-ui-1l06pbn">
           false
          </code>
          by default.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          You can set this option to
          <code class="leafygreen-ui-1l06pbn">
           true
          </code>
          only if you meet the following
requirements:
         </p>
         <ul class="leafygreen-ui-rioki0">
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            You specify only one host name.
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            You aren't connecting to a replica set.
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            The
            <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.srvMaxHosts" target="_self">
             <span>
              <code class="leafygreen-ui-1l06pbn">
               srvMaxHosts
              </code>
             </span>
            </a>
            option is unset or has a value of
            <code class="leafygreen-ui-1l06pbn">
             0
            </code>
            .
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            The
            <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#mongodb-urioption-urioption.directConnection" target="_self">
             <span>
              <code class="leafygreen-ui-1l06pbn">
               directConnection
              </code>
             </span>
            </a>
            option is unset or has a value of
            <code class="leafygreen-ui-1l06pbn">
             false
            </code>
            .
           </p>
          </li>
         </ul>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <dl class="urioption">
          <dt>
           <code class="leafygreen-ui-1l06pbn">
            srvMaxHosts
           </code>
           <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-urioption-urioption.srvMaxHosts" 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-urioption-urioption.srvMaxHosts">
            </div>
           </a>
          </dt>
          <dd>
          </dd>
         </dl>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         Specifies the number of
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos">
          <code class="leafygreen-ui-1l06pbn">
           mongos
          </code>
         </a>
         connections that can be created for
sharded topologies. Set this option to a non-negative integer.
         <code class="leafygreen-ui-1l06pbn">
          0
         </code>
         is the default value and means there is no limit on the number of
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos">
          <code class="leafygreen-ui-1l06pbn">
           mongos
          </code>
         </a>
         connections.
        </div>
       </div>
      </td>
     </tr>
    </tbody>
   </table>
  </div>
 </section>
</section>
