<section>
 <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium">
  Collation
  <a class="headerlink leafygreen-ui-1kepx47" href="#collation" title="Permalink to this heading">
   <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
    <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
    </path>
    <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
    </path>
   </svg>
   <div class="css-1btu0w3 evvkmar0" id="collation">
   </div>
  </a>
 </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="#collation-document" target="_self">
     <span>
      Collation Document
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#operations-that-support-collation" target="_self">
     <span>
      Operations that Support Collation
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#behavior" target="_self">
     <span>
      Behavior
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#restrictions" target="_self">
     <span>
      Restrictions
     </span>
    </a>
   </li>
  </ul>
 </div>
 <p class="leafygreen-ui-1kp3ins">
  Collation allows users to specify language-specific rules for string
comparison, such as rules for lettercase and accent marks.
 </p>
 <p class="leafygreen-ui-1kp3ins">
  You can specify collation for a collection or a view, an index, or
specific operations that support collation.
 </p>
 <p class="leafygreen-ui-1kp3ins">
  To specify collation when you query documents in the MongoDB Atlas UI, see
  <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/atlas/atlas-ui/documents/#specify-collation" target="_self">
   <span>
    Specify Collation
    <!-- -->
    .
   </span>
  </a>
 </p>
 <span class="leafygreen-ui-1qnjd6d" id="std-label-collation-document-fields">
 </span>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Collation Document
   <a class="headerlink leafygreen-ui-1kepx47" href="#collation-document" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="collation-document">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   A collation document has the following fields:
  </p>
  <script class="structured_data" type="application/ld+json">
   {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{\n   locale: &lt;string&gt;,\n   caseLevel: &lt;boolean&gt;,\n   caseFirst: &lt;string&gt;,\n   strength: &lt;int&gt;,\n   numericOrdering: &lt;boolean&gt;,\n   alternate: &lt;string&gt;,\n   maxVariable: &lt;string&gt;,\n   backwards: &lt;boolean&gt;\n}"}
  </script>
  <div class="css-16lmvu9">
   <div class="leafygreen-ui-196mwvg">
    <div class="leafygreen-ui-yzcs8i">
     <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{</td></tr><tr class=""><td class="leafygreen-ui-7razhx">   locale: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">   caseLevel: &lt;boolean&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">   caseFirst: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">   strength: &lt;int&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">   numericOrdering: &lt;boolean&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">   alternate: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">   maxVariable: &lt;string&gt;,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">   backwards: &lt;boolean&gt;</td></tr><tr class=""><td class="leafygreen-ui-7razhx">}</td></tr></tbody></table></code></pre>
     <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
      <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
       <div class="leafygreen-ui-xhlipt">
        <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
         <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
         </path>
        </svg>
       </div>
      </button>
     </div>
    </div>
   </div>
  </div>
  <p class="leafygreen-ui-1kp3ins">
   When specifying collation, the
   <code class="leafygreen-ui-1l06pbn">
    locale
   </code>
   field is mandatory; all
other collation fields are optional. For descriptions of the fields,
see
   <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-collation-document-fields" target="_self">
    <span>
     Collation Document
     <!-- -->
     .
    </span>
   </a>
  </p>
  <p class="leafygreen-ui-1kp3ins">
   Default collation parameter values vary depending on which
locale you specify. For a complete list of default collation
parameters and the locales they are associated with, see
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation-locales-defaults/#std-label-collation-default-params">
    Collation Default Parameters
    <!-- -->
    .
   </a>
  </p>
  <div class="leafygreen-ui-skkc39" tabindex="0">
   <table class="leafygreen-ui-hr8lsv">
    <colgroup>
     <col style="width:25%"/>
     <col style="width:20%"/>
     <col style="width:80%"/>
    </colgroup>
    <thead class="leafygreen-ui-a9ho40">
     <tr data-testid="leafygreen-ui-header-row">
      <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col">
       <div class="leafygreen-ui-ui0te9">
        <div>
         Field
        </div>
       </div>
      </th>
      <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
       <div class="leafygreen-ui-ui0te9">
        <div>
         Type
        </div>
       </div>
      </th>
      <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
       <div class="leafygreen-ui-ui0te9">
        <div>
         Description
        </div>
       </div>
      </th>
     </tr>
    </thead>
    <tbody>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <code class="leafygreen-ui-1l06pbn">
          locale
         </code>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         string
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          The ICU locale. See
          <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation-locales-defaults/#std-label-collation-languages-locales">
           Supported Languages and Locales
          </a>
          for a
list of supported locales.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          To specify simple binary comparison, specify
          <code class="leafygreen-ui-1l06pbn">
           locale
          </code>
          value of
          <code class="leafygreen-ui-1l06pbn">
           "simple"
          </code>
          .
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <code class="leafygreen-ui-1l06pbn">
          strength
         </code>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         integer
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <span class="leafygreen-ui-1qnjd6d" id="std-label-collation-parameter-strength">
         </span>
         <p class="leafygreen-ui-1kp3ins">
          Optional. The level of comparison to perform.
Corresponds to
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://unicode-org.github.io/icu/userguide/collation/concepts.html#comparison-levels" rel="noopener noreferrer">
           <span>
            ICU Comparison Levels
           </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>
          .
Possible values are:
         </p>
         <div class="leafygreen-ui-skkc39" tabindex="0">
          <table class="leafygreen-ui-hr8lsv">
           <colgroup>
            <col style="width:15%"/>
            <col style="width:90%"/>
           </colgroup>
           <thead class="leafygreen-ui-a9ho40">
            <tr data-testid="leafygreen-ui-header-row">
             <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col">
              <div class="leafygreen-ui-ui0te9">
               <div>
                Value
               </div>
              </div>
             </th>
             <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
              <div class="leafygreen-ui-ui0te9">
               <div>
                Description
               </div>
              </div>
             </th>
            </tr>
           </thead>
           <tbody>
            <tr class="">
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                1
               </div>
              </div>
             </td>
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                Primary level of comparison. Collation performs
comparisons of the base characters only, ignoring other
differences such as diacritics and case.
               </div>
              </div>
             </td>
            </tr>
            <tr class="">
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                2
               </div>
              </div>
             </td>
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                Secondary level of comparison. Collation performs comparisons
up to secondary differences, such as diacritics.
That is, collation performs comparisons of base characters
(primary differences) and diacritics (secondary differences).
Differences between base characters takes precedence over
secondary differences.
               </div>
              </div>
             </td>
            </tr>
            <tr class="">
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                3
               </div>
              </div>
             </td>
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                <p class="leafygreen-ui-1kp3ins">
                 Tertiary level of comparison. Collation performs comparisons
up to tertiary differences, such as case and letter variants.
That is, collation performs comparisons of base characters
(primary differences), diacritics (secondary differences), and
case and variants (tertiary differences). Differences between
base characters takes precedence over secondary differences,
which takes precedence over tertiary differences.
                </p>
                <p class="leafygreen-ui-1kp3ins">
                 This is the default level.
                </p>
               </div>
              </div>
             </td>
            </tr>
            <tr class="">
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                4
               </div>
              </div>
             </td>
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                Quaternary Level. Limited for specific use case to
consider punctuation when levels 1-3 ignore punctuation
or for processing Japanese text.
               </div>
              </div>
             </td>
            </tr>
            <tr class="">
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                5
               </div>
              </div>
             </td>
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                Identical Level. Limited for specific use case of tie
breaker.
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
         <p class="leafygreen-ui-1kp3ins">
          See
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://unicode-org.github.io/icu/userguide/collation/concepts.html#comparison-levels" rel="noopener noreferrer">
           <span>
            ICU Collation: Comparison Levels
           </span>
           <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16">
            <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor">
            </path>
            <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor">
            </path>
           </svg>
          </a>
          for details.
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <code class="leafygreen-ui-1l06pbn">
          caseLevel
         </code>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         boolean
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Optional. Flag that determines whether to include case comparison
at
          <code class="leafygreen-ui-1l06pbn">
           strength
          </code>
          level
          <code class="leafygreen-ui-1l06pbn">
           1
          </code>
          or
          <code class="leafygreen-ui-1l06pbn">
           2
          </code>
          .
         </p>
         <p class="leafygreen-ui-1kp3ins">
          If
          <code class="leafygreen-ui-1l06pbn">
           true
          </code>
          , include case comparison:
         </p>
         <ul class="leafygreen-ui-rioki0">
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            When used with
            <code class="leafygreen-ui-1l06pbn">
             strength:1
            </code>
            , collation compares base characters
and case.
           </p>
          </li>
          <li class="leafygreen-ui-d7p7b6">
           <p class="leafygreen-ui-1kp3ins">
            When used with
            <code class="leafygreen-ui-1l06pbn">
             strength:2
            </code>
            , collation compares base characters,
diacritics (and possible other secondary differences) and case.
           </p>
          </li>
         </ul>
         <p class="leafygreen-ui-1kp3ins">
          If
          <code class="leafygreen-ui-1l06pbn">
           false
          </code>
          , do not include case comparison at level
          <code class="leafygreen-ui-1l06pbn">
           1
          </code>
          or
          <code class="leafygreen-ui-1l06pbn">
           2
          </code>
          . The default is
          <code class="leafygreen-ui-1l06pbn">
           false
          </code>
          .
         </p>
         <p class="leafygreen-ui-1kp3ins">
          For more information, see
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://unicode-org.github.io/icu/userguide/collation/concepts.html#caselevel" rel="noopener noreferrer">
           <span>
            ICU Collation: Case Level
           </span>
           <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16">
            <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor">
            </path>
            <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor">
            </path>
           </svg>
          </a>
          .
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <code class="leafygreen-ui-1l06pbn">
          caseFirst
         </code>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         string
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Optional. A field that determines sort order of case differences during
tertiary level comparisons.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          Possible values are:
         </p>
         <div class="leafygreen-ui-skkc39" tabindex="0">
          <table class="leafygreen-ui-hr8lsv">
           <colgroup>
            <col style="width:30%"/>
            <col style="width:90%"/>
           </colgroup>
           <thead class="leafygreen-ui-a9ho40">
            <tr data-testid="leafygreen-ui-header-row">
             <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col">
              <div class="leafygreen-ui-ui0te9">
               <div>
                Value
               </div>
              </div>
             </th>
             <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
              <div class="leafygreen-ui-ui0te9">
               <div>
                Description
               </div>
              </div>
             </th>
            </tr>
           </thead>
           <tbody>
            <tr class="">
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                <code class="leafygreen-ui-1l06pbn">
                 "upper"
                </code>
               </div>
              </div>
             </td>
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                Uppercase sorts before lowercase.
               </div>
              </div>
             </td>
            </tr>
            <tr class="">
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                <code class="leafygreen-ui-1l06pbn">
                 "lower"
                </code>
               </div>
              </div>
             </td>
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                Lowercase sorts before uppercase.
               </div>
              </div>
             </td>
            </tr>
            <tr class="">
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                <code class="leafygreen-ui-1l06pbn">
                 "off"
                </code>
               </div>
              </div>
             </td>
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                Default value. Similar to
                <code class="leafygreen-ui-1l06pbn">
                 "lower"
                </code>
                with slight
differences. See
                <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://unicode-org.github.io/icu/userguide/strings/properties.html#customization" rel="noopener noreferrer">
                 <span>
                  https://unicode-org.github.io/icu/userguide/strings/properties.html#customization
                 </span>
                 <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16">
                  <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor">
                  </path>
                  <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor">
                  </path>
                 </svg>
                </a>
                for details of differences.
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <code class="leafygreen-ui-1l06pbn">
          numericOrdering
         </code>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         boolean
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Optional. Flag that determines whether to compare numeric strings as numbers
or as strings.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          If
          <code class="leafygreen-ui-1l06pbn">
           true
          </code>
          , compare as numbers. For example,
          <code class="leafygreen-ui-1l06pbn">
           "10"
          </code>
          is greater than
          <code class="leafygreen-ui-1l06pbn">
           "2"
          </code>
          .
         </p>
         <p class="leafygreen-ui-1kp3ins">
          If
          <code class="leafygreen-ui-1l06pbn">
           false
          </code>
          , compare as strings. For example,
          <code class="leafygreen-ui-1l06pbn">
           "10"
          </code>
          is less than
          <code class="leafygreen-ui-1l06pbn">
           "2"
          </code>
          .
         </p>
         <p class="leafygreen-ui-1kp3ins">
          Default is
          <code class="leafygreen-ui-1l06pbn">
           false
          </code>
          .
         </p>
         <p class="leafygreen-ui-1kp3ins">
          See
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-numeric-order-restrictions" target="_self">
           <span>
            numericOrdering Restrictions
            <!-- -->
            .
           </span>
          </a>
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <code class="leafygreen-ui-1l06pbn">
          alternate
         </code>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         string
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Optional. Field that determines whether collation should consider whitespace
and punctuation as base characters for purposes of comparison.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          Possible values are:
         </p>
         <div class="leafygreen-ui-skkc39" tabindex="0">
          <table class="leafygreen-ui-hr8lsv">
           <colgroup>
            <col style="width:30%"/>
            <col style="width:90%"/>
           </colgroup>
           <thead class="leafygreen-ui-a9ho40">
            <tr data-testid="leafygreen-ui-header-row">
             <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col">
              <div class="leafygreen-ui-ui0te9">
               <div>
                Value
               </div>
              </div>
             </th>
             <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
              <div class="leafygreen-ui-ui0te9">
               <div>
                Description
               </div>
              </div>
             </th>
            </tr>
           </thead>
           <tbody>
            <tr class="">
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                <code class="leafygreen-ui-1l06pbn">
                 "non-ignorable"
                </code>
               </div>
              </div>
             </td>
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                Whitespace and punctuation are considered base characters.
               </div>
              </div>
             </td>
            </tr>
            <tr class="">
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                <code class="leafygreen-ui-1l06pbn">
                 "shifted"
                </code>
               </div>
              </div>
             </td>
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                Whitespace and punctuation are not considered base characters
and are only distinguished at strength levels greater than 3.
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
         <p class="leafygreen-ui-1kp3ins">
          See
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://unicode-org.github.io/icu/userguide/collation/concepts.html#comparison-levels" rel="noopener noreferrer">
           <span>
            ICU Collation: Comparison Levels
           </span>
           <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16">
            <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor">
            </path>
            <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor">
            </path>
           </svg>
          </a>
          for more information.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          Default is
          <code class="leafygreen-ui-1l06pbn">
           "non-ignorable"
          </code>
          .
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <code class="leafygreen-ui-1l06pbn">
          maxVariable
         </code>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         string
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Optional. Field that determines up to which characters are considered
ignorable when
          <code class="leafygreen-ui-1l06pbn">
           alternate: "shifted"
          </code>
          . Has no effect if
          <code class="leafygreen-ui-1l06pbn">
           alternate: "non-ignorable"
          </code>
         </p>
         <p class="leafygreen-ui-1kp3ins">
          Possible values are:
         </p>
         <div class="leafygreen-ui-skkc39" tabindex="0">
          <table class="leafygreen-ui-hr8lsv">
           <colgroup>
            <col style="width:30%"/>
            <col style="width:90%"/>
           </colgroup>
           <thead class="leafygreen-ui-a9ho40">
            <tr data-testid="leafygreen-ui-header-row">
             <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col">
              <div class="leafygreen-ui-ui0te9">
               <div>
                Value
               </div>
              </div>
             </th>
             <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
              <div class="leafygreen-ui-ui0te9">
               <div>
                Description
               </div>
              </div>
             </th>
            </tr>
           </thead>
           <tbody>
            <tr class="">
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                <code class="leafygreen-ui-1l06pbn">
                 "punct"
                </code>
               </div>
              </div>
             </td>
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                Both whitespace and punctuation are ignorable and not
considered base characters.
               </div>
              </div>
             </td>
            </tr>
            <tr class="">
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                <code class="leafygreen-ui-1l06pbn">
                 "space"
                </code>
               </div>
              </div>
             </td>
             <td class="leafygreen-ui-1drjk7h">
              <div class="leafygreen-ui-1n4j8xf">
               <div>
                Whitespace is ignorable and not considered to be base
characters.
               </div>
              </div>
             </td>
            </tr>
           </tbody>
          </table>
         </div>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <code class="leafygreen-ui-1l06pbn">
          backwards
         </code>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         boolean
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Optional. Flag that determines whether strings with diacritics sort from back
of the string, such as with some French dictionary ordering.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          If
          <code class="leafygreen-ui-1l06pbn">
           true
          </code>
          , compare from back to front.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          If
          <code class="leafygreen-ui-1l06pbn">
           false
          </code>
          , compare from front to back.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          The default value is
          <code class="leafygreen-ui-1l06pbn">
           false
          </code>
          .
         </p>
        </div>
       </div>
      </td>
     </tr>
     <tr class="">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <code class="leafygreen-ui-1l06pbn">
          normalization
         </code>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         boolean
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <p class="leafygreen-ui-1kp3ins">
          Optional. Flag that determines whether to check if text require normalization
and to perform normalization. Generally, majority of text does not
require this normalization processing.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          If
          <code class="leafygreen-ui-1l06pbn">
           true
          </code>
          , check if fully normalized and perform normalization to
compare text.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          If
          <code class="leafygreen-ui-1l06pbn">
           false
          </code>
          , does not check.
         </p>
         <p class="leafygreen-ui-1kp3ins">
          The default value is
          <code class="leafygreen-ui-1l06pbn">
           false
          </code>
          .
         </p>
         <p class="leafygreen-ui-1kp3ins">
          See
          <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://unicode-org.github.io/icu/userguide/collation/concepts.html#normalization" rel="noopener noreferrer">
           <span>
            https://unicode-org.github.io/icu/userguide/collation/concepts.html#normalization
           </span>
           <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16">
            <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor">
            </path>
            <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor">
            </path>
           </svg>
          </a>
          for details.
         </p>
        </div>
       </div>
      </td>
     </tr>
    </tbody>
   </table>
  </div>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Operations that Support Collation
   <a class="headerlink leafygreen-ui-1kepx47" href="#operations-that-support-collation" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="operations-that-support-collation">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   You can specify collation for the following operations:
  </p>
  <div class="leafygreen-ui-15mdk4" role="note">
   <h2 class="leafygreen-ui-6n7b7d">
    Note
   </h2>
   <div class="leafygreen-ui-9mycqc">
    <p class="leafygreen-ui-1kp3ins">
     You cannot specify multiple collations for an operation. For
example, you cannot specify different collations per field, or if
performing a find with a sort, you cannot use one collation for the
find and another for the sort.
    </p>
   </div>
  </div>
  <div class="header-buffer" id="ref-index-restriction-id1">
  </div>
  <div class="header-buffer" id="ref-index-restriction-id2">
  </div>
  <div class="leafygreen-ui-skkc39" tabindex="0">
   <table class="leafygreen-ui-hr8lsv">
    <thead class="leafygreen-ui-a9ho40">
     <tr data-testid="leafygreen-ui-header-row">
      <th class="leafygreen-ui-1trtg6r" role="columnheader" scope="col">
       <div class="leafygreen-ui-ui0te9">
        <div>
         Commands
        </div>
       </div>
      </th>
      <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
       <div class="leafygreen-ui-ui0te9">
        <div>
         <code class="leafygreen-ui-1l06pbn">
          mongosh
         </code>
         Methods
        </div>
       </div>
      </th>
     </tr>
    </thead>
    <tbody>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/create/#mongodb-dbcommand-dbcmd.create">
          <code class="leafygreen-ui-1l06pbn">
           create
          </code>
         </a>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <div class="line-block">
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createCollection/#mongodb-method-db.createCollection">
            <code class="leafygreen-ui-1l06pbn">
             db.createCollection()
            </code>
           </a>
          </div>
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createView/#mongodb-method-db.createView">
            <code class="leafygreen-ui-1l06pbn">
             db.createView()
            </code>
           </a>
          </div>
         </div>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/createIndexes/#mongodb-dbcommand-dbcmd.createIndexes">
          <code class="leafygreen-ui-1l06pbn">
           createIndexes
          </code>
         </a>
         <a class="footnote-reference header-buffer" href="#footnote-index-restriction" id="ref-index-restriction-id1">
          [
          <!-- -->
          1
          <!-- -->
          ]
         </a>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.createIndex/#mongodb-method-db.collection.createIndex">
          <code class="leafygreen-ui-1l06pbn">
           db.collection.createIndex()
          </code>
         </a>
         <a class="footnote-reference header-buffer" href="#footnote-index-restriction" id="ref-index-restriction-id2">
          [
          <!-- -->
          1
          <!-- -->
          ]
         </a>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/aggregate/#mongodb-dbcommand-dbcmd.aggregate">
          <code class="leafygreen-ui-1l06pbn">
           aggregate
          </code>
         </a>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.aggregate/#mongodb-method-db.collection.aggregate">
          <code class="leafygreen-ui-1l06pbn">
           db.collection.aggregate()
          </code>
         </a>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/distinct/#mongodb-dbcommand-dbcmd.distinct">
          <code class="leafygreen-ui-1l06pbn">
           distinct
          </code>
         </a>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.distinct/#mongodb-method-db.collection.distinct">
          <code class="leafygreen-ui-1l06pbn">
           db.collection.distinct()
          </code>
         </a>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/findAndModify/#mongodb-dbcommand-dbcmd.findAndModify">
          <code class="leafygreen-ui-1l06pbn">
           findAndModify
          </code>
         </a>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <div class="line-block">
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findAndModify/#mongodb-method-db.collection.findAndModify">
            <code class="leafygreen-ui-1l06pbn">
             db.collection.findAndModify()
            </code>
           </a>
          </div>
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findOneAndDelete/#mongodb-method-db.collection.findOneAndDelete">
            <code class="leafygreen-ui-1l06pbn">
             db.collection.findOneAndDelete()
            </code>
           </a>
          </div>
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findOneAndReplace/#mongodb-method-db.collection.findOneAndReplace">
            <code class="leafygreen-ui-1l06pbn">
             db.collection.findOneAndReplace()
            </code>
           </a>
          </div>
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.findOneAndUpdate/#mongodb-method-db.collection.findOneAndUpdate">
            <code class="leafygreen-ui-1l06pbn">
             db.collection.findOneAndUpdate()
            </code>
           </a>
          </div>
         </div>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/find/#mongodb-dbcommand-dbcmd.find">
          <code class="leafygreen-ui-1l06pbn">
           find
          </code>
         </a>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/cursor.collation/#mongodb-method-cursor.collation">
          <code class="leafygreen-ui-1l06pbn">
           cursor.collation()
          </code>
         </a>
         to specify collation for
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find">
          <code class="leafygreen-ui-1l06pbn">
           db.collection.find()
          </code>
         </a>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/mapReduce/#mongodb-dbcommand-dbcmd.mapReduce">
          <code class="leafygreen-ui-1l06pbn">
           mapReduce
          </code>
         </a>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.mapReduce/#mongodb-method-db.collection.mapReduce">
          <code class="leafygreen-ui-1l06pbn">
           db.collection.mapReduce()
          </code>
         </a>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/delete/#mongodb-dbcommand-dbcmd.delete">
          <code class="leafygreen-ui-1l06pbn">
           delete
          </code>
         </a>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <div class="line-block">
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.deleteOne/#mongodb-method-db.collection.deleteOne">
            <code class="leafygreen-ui-1l06pbn">
             db.collection.deleteOne()
            </code>
           </a>
          </div>
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.deleteMany/#mongodb-method-db.collection.deleteMany">
            <code class="leafygreen-ui-1l06pbn">
             db.collection.deleteMany()
            </code>
           </a>
          </div>
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.remove/#mongodb-method-db.collection.remove">
            <code class="leafygreen-ui-1l06pbn">
             db.collection.remove()
            </code>
           </a>
          </div>
         </div>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/update/#mongodb-dbcommand-dbcmd.update">
          <code class="leafygreen-ui-1l06pbn">
           update
          </code>
         </a>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <div class="line-block">
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateOne/#mongodb-method-db.collection.updateOne">
            <code class="leafygreen-ui-1l06pbn">
             db.collection.updateOne()
            </code>
           </a>
           ,
          </div>
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.updateMany/#mongodb-method-db.collection.updateMany">
            <code class="leafygreen-ui-1l06pbn">
             db.collection.updateMany()
            </code>
           </a>
           ,
          </div>
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.replaceOne/#mongodb-method-db.collection.replaceOne">
            <code class="leafygreen-ui-1l06pbn">
             db.collection.replaceOne()
            </code>
           </a>
          </div>
         </div>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/shardCollection/#mongodb-dbcommand-dbcmd.shardCollection">
          <code class="leafygreen-ui-1l06pbn">
           shardCollection
          </code>
         </a>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <div class="line-block">
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/sh.shardCollection/#mongodb-method-sh.shardCollection">
            <code class="leafygreen-ui-1l06pbn">
             sh.shardCollection()
            </code>
           </a>
          </div>
         </div>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/command/count/#mongodb-dbcommand-dbcmd.count">
          <code class="leafygreen-ui-1l06pbn">
           count
          </code>
         </a>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         <div class="line-block">
          <div class="line">
           <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.count/#mongodb-method-db.collection.count">
            <code class="leafygreen-ui-1l06pbn">
             db.collection.count()
            </code>
           </a>
          </div>
         </div>
        </div>
       </div>
      </td>
     </tr>
     <tr class="leafygreen-ui-15dvrnp">
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
        </div>
       </div>
      </td>
      <td class="leafygreen-ui-1drjk7h">
       <div class="leafygreen-ui-1n4j8xf">
        <div>
         Individual update, replace, and delete operations in
         <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.bulkWrite/#mongodb-method-db.collection.bulkWrite">
          <code class="leafygreen-ui-1l06pbn">
           db.collection.bulkWrite()
          </code>
          .
         </a>
        </div>
       </div>
      </td>
     </tr>
    </tbody>
   </table>
  </div>
  <table class="header-buffer leafygreen-ui-rbqgrl" frame="void" id="footnote-index-restriction" rules="none">
   <colgroup>
    <col/>
   </colgroup>
   <tbody valign="top">
    <tr>
     <td class="leafygreen-ui-17r2xs0">
      [
      <!-- -->
      1
      <!-- -->
      ]
     </td>
     <td class="leafygreen-ui-17r2xs0">
      <em>
       (
       <a href="#ref-index-restriction-id1">
        1
       </a>
       ,
       <a href="#ref-index-restriction-id2">
        2
       </a>
       )
      </em>
      <!-- -->
      Some index types do not support collation. See
      <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-collation-unsupported-index-types" target="_self">
       <span>
        Collation and Unsupported Index Types
       </span>
      </a>
      for details.
     </td>
    </tr>
   </tbody>
  </table>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Behavior
   <a class="headerlink leafygreen-ui-1kepx47" href="#behavior" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="behavior">
    </div>
   </a>
  </h2>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Local Variants
    <a class="headerlink leafygreen-ui-1kepx47" href="#local-variants" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="local-variants">
     </div>
    </a>
   </h3>
   <p class="leafygreen-ui-1kp3ins">
    Some collation locales have variants, which employ special
language-specific rules. To specify a locale variant, use the following
syntax:
   </p>
   <script class="structured_data" type="application/ld+json">
    {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"locale\" : \"&lt;locale&gt;@collation=&lt;variant&gt;\" }","programmingLanguage":"JavaScript"}
   </script>
   <div class="css-16lmvu9">
    <div class="leafygreen-ui-196mwvg">
     <div class="leafygreen-ui-yzcs8i">
      <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"locale"</span> <!-- -->: <span class="lg-highlight-string">"&lt;locale code&gt;@collation=&lt;variant&gt;"</span> }</td></tr></tbody></table></code></pre>
      <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
       <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
        <div class="leafygreen-ui-xhlipt">
         <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
          <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
          </path>
         </svg>
        </div>
       </button>
      </div>
     </div>
    </div>
   </div>
   <p class="leafygreen-ui-1kp3ins">
    For example, to use the
    <code class="leafygreen-ui-1l06pbn">
     unihan
    </code>
    variant of the Chinese collation:
   </p>
   <script class="structured_data" type="application/ld+json">
    {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"locale\" : \"zh@collation=unihan\" }","programmingLanguage":"JavaScript"}
   </script>
   <div class="css-16lmvu9">
    <div class="leafygreen-ui-196mwvg">
     <div class="leafygreen-ui-yzcs8i">
      <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"locale"</span> <!-- -->: <span class="lg-highlight-string">"zh@collation=unihan"</span> }</td></tr></tbody></table></code></pre>
      <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
       <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
        <div class="leafygreen-ui-xhlipt">
         <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
          <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
          </path>
         </svg>
        </div>
       </button>
      </div>
     </div>
    </div>
   </div>
   <p class="leafygreen-ui-1kp3ins">
    For a complete list of all collation locales and their variants, see
    <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/collation-locales-defaults/#std-label-collation-languages-locales">
     Collation Locales
     <!-- -->
     .
    </a>
   </p>
   <span class="leafygreen-ui-1qnjd6d" id="std-label-ref-collation-and-views">
   </span>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Collation and Views
    <a class="headerlink leafygreen-ui-1kepx47" href="#collation-and-views" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="collation-and-views">
     </div>
    </a>
   </h3>
   <ul class="leafygreen-ui-rioki0">
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      You can specify a default
      <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-collation" target="_self">
       <span>
        collation
       </span>
      </a>
      for a view at creation time. If no collation is specified, the
view's default collation is the "simple" binary comparison
collator. That is, the view does not inherit the collection's
default collation.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      String comparisons on the view use the view's default collation.
An operation that attempts to change or override a view's default
collation will fail with an error.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      If creating a view from another view, you cannot specify a
collation that differs from the source view's collation.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      If performing an aggregation that involves multiple views, such as
with
      <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/lookup/#mongodb-pipeline-pipe.-lookup">
       <code class="leafygreen-ui-1l06pbn">
        $lookup
       </code>
      </a>
      or
      <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/aggregation/graphLookup/#mongodb-pipeline-pipe.-graphLookup">
       <code class="leafygreen-ui-1l06pbn">
        $graphLookup
       </code>
      </a>
      , the views must
have the same
      <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-collation" target="_self">
       <span>
        collation
        <!-- -->
        .
       </span>
      </a>
     </p>
    </li>
   </ul>
   <span class="leafygreen-ui-1qnjd6d" id="std-label-collation-index-use">
   </span>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Collation and Index Use
    <a class="headerlink leafygreen-ui-1kepx47" href="#collation-and-index-use" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="collation-and-index-use">
     </div>
    </a>
   </h3>
   <p class="leafygreen-ui-1kp3ins">
    To use an index for string comparisons, an operation must also
specify the same collation. That is, an index with a collation
cannot support an operation that performs string comparisons on the
indexed fields if the operation specifies a different collation.
   </p>
   <div class="leafygreen-ui-1sjx7ru" role="note">
    <h2 class="leafygreen-ui-29m78u">
     Warning
    </h2>
    <div class="leafygreen-ui-9mycqc">
     <p class="leafygreen-ui-1kp3ins">
      Because indexes that are configured with collation use ICU
collation keys to achieve sort order, collation-aware index keys
may be larger than index keys for indexes without collation.
     </p>
    </div>
   </div>
   <p class="leafygreen-ui-1kp3ins">
    For example, the collection
    <code class="leafygreen-ui-1l06pbn">
     myColl
    </code>
    has an index on a string
field
    <code class="leafygreen-ui-1l06pbn">
     category
    </code>
    with the collation locale
    <code class="leafygreen-ui-1l06pbn">
     "fr"
    </code>
    .
   </p>
   <script class="structured_data" type="application/ld+json">
    {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.createIndex( { category: 1 }, { collation: { locale: \"fr\" } } )","programmingLanguage":"JavaScript"}
   </script>
   <div class="css-16lmvu9">
    <div class="leafygreen-ui-196mwvg">
     <div class="leafygreen-ui-1b1bvay">
      <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-number">1</span> }<!-- -->, <!-- -->{ <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span> } } )</td></tr></tbody></table></code></pre>
      <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
       <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
        <div class="leafygreen-ui-xhlipt">
         <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
          <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
          </path>
         </svg>
        </div>
       </button>
      </div>
     </div>
    </div>
   </div>
   <p class="leafygreen-ui-1kp3ins">
    The following query operation, which specifies the same collation as
the index, can use the index:
   </p>
   <script class="structured_data" type="application/ld+json">
    {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { category: \"cafe\" } ).collation( { locale: \"fr\" } )","programmingLanguage":"JavaScript"}
   </script>
   <div class="css-16lmvu9">
    <div class="leafygreen-ui-196mwvg">
     <div class="leafygreen-ui-1b1bvay">
      <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> } ).<span class="lg-highlight-title lg-highlight-function">collation</span>( <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span> } )</td></tr></tbody></table></code></pre>
      <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
       <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
        <div class="leafygreen-ui-xhlipt">
         <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
          <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
          </path>
         </svg>
        </div>
       </button>
      </div>
     </div>
    </div>
   </div>
   <p class="leafygreen-ui-1kp3ins">
    However, the following query operation, which by default uses the
"simple" binary collator, cannot use the index:
   </p>
   <script class="structured_data" type="application/ld+json">
    {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { category: \"cafe\" } )","programmingLanguage":"JavaScript"}
   </script>
   <div class="css-16lmvu9">
    <div class="leafygreen-ui-196mwvg">
     <div class="leafygreen-ui-yzcs8i">
      <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> } )</td></tr></tbody></table></code></pre>
      <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
       <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
        <div class="leafygreen-ui-xhlipt">
         <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
          <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
          </path>
         </svg>
        </div>
       </button>
      </div>
     </div>
    </div>
   </div>
   <p class="leafygreen-ui-1kp3ins">
    For a compound index where the index prefix keys are not strings,
arrays, and embedded documents, an operation that specifies a
different collation can still use the index to support comparisons
on the index prefix keys.
   </p>
   <p class="leafygreen-ui-1kp3ins">
    For example, the collection
    <code class="leafygreen-ui-1l06pbn">
     myColl
    </code>
    has a compound index on the
numeric fields
    <code class="leafygreen-ui-1l06pbn">
     score
    </code>
    and
    <code class="leafygreen-ui-1l06pbn">
     price
    </code>
    and the string field
    <code class="leafygreen-ui-1l06pbn">
     category
    </code>
    ; the index is created with the  collation locale
    <code class="leafygreen-ui-1l06pbn">
     "fr"
    </code>
    for string comparisons:
   </p>
   <script class="structured_data" type="application/ld+json">
    {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.createIndex(\n   { score: 1, price: 1, category: 1 },\n   { collation: { locale: \"fr\" } } )","programmingLanguage":"JavaScript"}
   </script>
   <div class="css-16lmvu9">
    <div class="leafygreen-ui-196mwvg">
     <div class="leafygreen-ui-yzcs8i">
      <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">createIndex</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx">   <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-number">1</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">   <!-- -->{ <span class="lg-highlight-attr">collation</span>: <!-- -->{ <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">"fr"</span> } } )</td></tr></tbody></table></code></pre>
      <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
       <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
        <div class="leafygreen-ui-xhlipt">
         <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
          <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
          </path>
         </svg>
        </div>
       </button>
      </div>
     </div>
    </div>
   </div>
   <p class="leafygreen-ui-1kp3ins">
    The following operations, which use
    <code class="leafygreen-ui-1l06pbn">
     "simple"
    </code>
    binary collation
for string comparisons, can use the index:
   </p>
   <script class="structured_data" type="application/ld+json">
    {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { score: 5 } ).sort( { price: 1 } )\ndb.myColl.find( { score: 5, price: { $gt: NumberDecimal( \"10\" ) } } ).sort( { price: 1 } )","programmingLanguage":"JavaScript"}
   </script>
   <div class="css-16lmvu9">
    <div class="leafygreen-ui-196mwvg">
     <div class="leafygreen-ui-1b1bvay">
      <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">5</span> } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span> } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">price</span>: <!-- -->{ <span class="lg-highlight-attr">$gt</span>: <span class="lg-highlight-title lg-highlight-class">NumberDecimal</span>( <span class="lg-highlight-string">"10"</span> ) } } ).<span class="lg-highlight-title lg-highlight-function">sort</span>( <!-- -->{ <span class="lg-highlight-attr">price</span>: <span class="lg-highlight-number">1</span> } )</td></tr></tbody></table></code></pre>
      <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
       <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
        <div class="leafygreen-ui-xhlipt">
         <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
          <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
          </path>
         </svg>
        </div>
       </button>
      </div>
     </div>
    </div>
   </div>
   <p class="leafygreen-ui-1kp3ins">
    The following operation, which uses
    <code class="leafygreen-ui-1l06pbn">
     "simple"
    </code>
    binary collation
for string comparisons on the indexed
    <code class="leafygreen-ui-1l06pbn">
     category
    </code>
    field, can use
the index to fulfill only the
    <code class="leafygreen-ui-1l06pbn">
     score: 5
    </code>
    portion of the query:
   </p>
   <script class="structured_data" type="application/ld+json">
    {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.myColl.find( { score: 5, category: \"cafe\" } )","programmingLanguage":"JavaScript"}
   </script>
   <div class="css-16lmvu9">
    <div class="leafygreen-ui-196mwvg">
     <div class="leafygreen-ui-yzcs8i">
      <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">myColl</span>.<span class="lg-highlight-title lg-highlight-function">find</span>( <!-- -->{ <span class="lg-highlight-attr">score</span>: <span class="lg-highlight-number">5</span>, <span class="lg-highlight-attr">category</span>: <span class="lg-highlight-string">"cafe"</span> } )</td></tr></tbody></table></code></pre>
      <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
       <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
        <div class="leafygreen-ui-xhlipt">
         <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
          <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
          </path>
         </svg>
        </div>
       </button>
      </div>
     </div>
    </div>
   </div>
   <div class="leafygreen-ui-85da11" role="note">
    <h2 class="leafygreen-ui-1ac4g5h">
     Important
    </h2>
    <div class="leafygreen-ui-9mycqc">
     <p class="leafygreen-ui-1kp3ins">
      Matches against document keys, including embedded document keys,
use simple binary comparison. This means that a query for a key
like "foo.bár" will not match the key "foo.bar", regardless of the value you
set for the
      <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-collation-parameter-strength" target="_self">
       <span>
        strength
       </span>
      </a>
      parameter.
     </p>
    </div>
   </div>
   <span class="leafygreen-ui-1qnjd6d" id="std-label-collation-unsupported-index-types">
   </span>
   <section>
    <h4 class="contains-headerlink leafygreen-ui-1vzlt5f">
     Collation and Unsupported Index Types
     <a class="headerlink leafygreen-ui-1kepx47" href="#collation-and-unsupported-index-types" title="Permalink to this heading">
      <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
       <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
       </path>
       <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
       </path>
      </svg>
      <div class="css-1btu0w3 evvkmar0" id="collation-and-unsupported-index-types">
      </div>
     </a>
    </h4>
    <p class="leafygreen-ui-1kp3ins">
     The following indexes only support simple binary comparison and do
not support
     <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="#std-label-collation" target="_self">
      <span>
       collation
       <!-- -->
       :
      </span>
     </a>
    </p>
    <ul class="leafygreen-ui-rioki0">
     <li class="leafygreen-ui-d7p7b6">
      <p class="leafygreen-ui-1kp3ins">
       <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/index-text/#std-label-index-type-text">
        Text
       </a>
       indexes
      </p>
     </li>
     <li class="leafygreen-ui-d7p7b6">
      <p class="leafygreen-ui-1kp3ins">
       <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/indexes/index-types/geospatial/2d/#std-label-2d-index">
        2d
       </a>
       indexes
      </p>
     </li>
    </ul>
    <div class="leafygreen-ui-13vw3ie" role="note">
     <h2 class="leafygreen-ui-1fn4p2b">
      Tip
     </h2>
     <div class="leafygreen-ui-9mycqc">
      <p class="leafygreen-ui-1kp3ins">
       To create a
       <code class="leafygreen-ui-1l06pbn">
        text
       </code>
       or
       <code class="leafygreen-ui-1l06pbn">
        2d
       </code>
       index on a collection that has a
non-simple collation, you must explicitly specify
       <code class="leafygreen-ui-1l06pbn">
        {collation:
{locale: "simple"} }
       </code>
       when creating the index.
      </p>
     </div>
    </div>
   </section>
  </section>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Restrictions
   <a class="headerlink leafygreen-ui-1kepx47" href="#restrictions" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="restrictions">
    </div>
   </a>
  </h2>
  <span class="leafygreen-ui-1qnjd6d" id="std-label-numeric-order-restrictions">
  </span>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    numericOrdering
    <a class="headerlink leafygreen-ui-1kepx47" href="#numericordering" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="numericordering">
     </div>
    </a>
   </h3>
   <p class="leafygreen-ui-1kp3ins">
    When specifying the
    <code class="leafygreen-ui-1l06pbn">
     numericOrdering
    </code>
    as
    <code class="leafygreen-ui-1l06pbn">
     true
    </code>
    the following
restrictions apply:
   </p>
   <ul class="leafygreen-ui-rioki0">
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      Only contiguous non-negative integer substrings of digits are
considered in the comparisons.
     </p>
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       numericOrdering
      </code>
      does not support:
     </p>
     <ul class="leafygreen-ui-rioki0">
      <li class="leafygreen-ui-d7p7b6">
       <p class="leafygreen-ui-1kp3ins">
        <code class="leafygreen-ui-1l06pbn">
         +
        </code>
       </p>
      </li>
      <li class="leafygreen-ui-d7p7b6">
       <p class="leafygreen-ui-1kp3ins">
        <code class="leafygreen-ui-1l06pbn">
         -
        </code>
       </p>
      </li>
      <li class="leafygreen-ui-d7p7b6">
       <p class="leafygreen-ui-1kp3ins">
        decimal separators, like decimal points and decimal commas
       </p>
      </li>
      <li class="leafygreen-ui-d7p7b6">
       <p class="leafygreen-ui-1kp3ins">
        exponents
       </p>
      </li>
     </ul>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      Only Unicode code points in the Number or Decimal Digit (Nd) category
are treated as digits.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      If a digit length exceeds 254 characters, the excess characters are
treated as a separate number.
     </p>
    </li>
   </ul>
   <p class="leafygreen-ui-1kp3ins">
    Consider a collection with the following string number and decimal
values:
   </p>
   <script class="structured_data" type="application/ld+json">
    {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.c.insertMany(\n  [\n      { \"n\" : \"1\" },\n      { \"n\" : \"2\" },\n      { \"n\" : \"2.1\" },\n      { \"n\" : \"-2.1\" },\n      { \"n\" : \"2.2\" },\n      { \"n\" : \"2.10\" },\n      { \"n\" : \"2.20\" },\n      { \"n\" : \"-10\" },\n      { \"n\" : \"10\" },\n      { \"n\" : \"20\" },\n      { \"n\" : \"20.1\" }\n  ]\n)","programmingLanguage":"JavaScript"}
   </script>
   <div class="css-16lmvu9">
    <div class="leafygreen-ui-196mwvg">
     <div class="leafygreen-ui-yzcs8i">
      <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">c</span>.<span class="lg-highlight-title lg-highlight-function">insertMany</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx">  <!-- -->[</td></tr><tr class=""><td class="leafygreen-ui-7razhx">      <!-- -->{ <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-string">"1"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">      <!-- -->{ <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-string">"2"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">      <!-- -->{ <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-string">"2.1"</span> }<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">      <!-- -->{ <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-string">"-2.1"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">      <!-- -->{ <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-string">"2.2"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">      <!-- -->{ <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-string">"2.10"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">      <!-- -->{ <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-string">"2.20"</span> }<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">      <!-- -->{ <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-string">"-10"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">      <!-- -->{ <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-string">"10"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">      <!-- -->{ <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-string">"20"</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">      <!-- -->{ <span class="lg-highlight-string">"n"</span> <!-- -->: <span class="lg-highlight-string">"20.1"</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">  ]</td></tr><tr class=""><td class="leafygreen-ui-7razhx">)</td></tr></tbody></table></code></pre>
      <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
       <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
        <div class="leafygreen-ui-xhlipt">
         <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
          <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
          </path>
         </svg>
        </div>
       </button>
      </div>
     </div>
    </div>
   </div>
   <p class="leafygreen-ui-1kp3ins">
    The following
    <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.collection.find/#mongodb-method-db.collection.find">
     <code class="leafygreen-ui-1l06pbn">
      find
     </code>
    </a>
    query uses a
collation document containing the
    <code class="leafygreen-ui-1l06pbn">
     numericOrdering
    </code>
    parameter:
   </p>
   <script class="structured_data" type="application/ld+json">
    {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.c.find(\n   { }, { _id: 0 }\n).sort(\n  { n: 1 }\n).collation( {\n  locale: 'en_US',\n  numericOrdering: true\n} )","programmingLanguage":"JavaScript"}
   </script>
   <div class="css-16lmvu9">
    <div class="leafygreen-ui-196mwvg">
     <div class="leafygreen-ui-yzcs8i">
      <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.<span class="lg-highlight-property">c</span>.<span class="lg-highlight-title lg-highlight-function">find</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx">   <!-- -->{ <!-- -->}<!-- -->, <!-- -->{ <span class="lg-highlight-attr">_id</span>: <span class="lg-highlight-number">0</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">).<span class="lg-highlight-title lg-highlight-function">sort</span>(</td></tr><tr class=""><td class="leafygreen-ui-7razhx">  <!-- -->{ <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-number">1</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">).<span class="lg-highlight-title lg-highlight-function">collation</span>( <!-- -->{</td></tr><tr class=""><td class="leafygreen-ui-7razhx">  <span class="lg-highlight-attr">locale</span>: <span class="lg-highlight-string">'en_US'</span>,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">  <span class="lg-highlight-attr">numericOrdering</span>: <span class="lg-highlight-literal">true</span></td></tr><tr class=""><td class="leafygreen-ui-7razhx">} )</td></tr></tbody></table></code></pre>
      <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
       <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
        <div class="leafygreen-ui-xhlipt">
         <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
          <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
          </path>
         </svg>
        </div>
       </button>
      </div>
     </div>
    </div>
   </div>
   <p class="leafygreen-ui-1kp3ins">
    The operation returns the following results:
   </p>
   <script class="structured_data" type="application/ld+json">
    {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"[\n    { n: '-2.1' },\n    { n: '-10' },\n    { n: '1' },\n    { n: '2' },\n    { n: '2.1' },\n    { n: '2.2' },\n    { n: '2.10' },\n    { n: '2.20' },\n    { n: '10' },\n    { n: '20' },\n    { n: '20.1' }\n]","programmingLanguage":"JavaScript"}
   </script>
   <div class="css-1lju8ps">
    <div class="leafygreen-ui-196mwvg">
     <div class="leafygreen-ui-1jheeh3">
      <pre class="leafygreen-ui-1453az5" tabindex="-1"><code class="lg-highlight-hljs-light javascript leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">[</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">    <!-- -->{ <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-string">'-2.1'</span> }<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">    <!-- -->{ <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-string">'-10'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">    <!-- -->{ <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-string">'1'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">    <!-- -->{ <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-string">'2'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">    <!-- -->{ <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-string">'2.1'</span> }<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">    <!-- -->{ <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-string">'2.2'</span> }<!-- -->,</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">    <!-- -->{ <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-string">'2.10'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">    <!-- -->{ <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-string">'2.20'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">    <!-- -->{ <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-string">'10'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">    <!-- -->{ <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-string">'20'</span> }<!-- -->,</td></tr><tr class=""><td class="leafygreen-ui-7razhx">    <!-- -->{ <span class="lg-highlight-attr">n</span>: <span class="lg-highlight-string">'20.1'</span> }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">]</td></tr></tbody></table></code></pre>
     </div>
    </div>
   </div>
   <ul class="leafygreen-ui-rioki0">
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       numericOrdering: true
      </code>
      sorts the string values in ascending
order as if they were numeric values.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      The two negative values
      <code class="leafygreen-ui-1l06pbn">
       -2.1
      </code>
      and
      <code class="leafygreen-ui-1l06pbn">
       -10
      </code>
      are not sorted in the
expected sort order because they have unsupported
      <code class="leafygreen-ui-1l06pbn">
       -
      </code>
      characters.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      The value
      <code class="leafygreen-ui-1l06pbn">
       2.2
      </code>
      is sorted before the value
      <code class="leafygreen-ui-1l06pbn">
       2.10
      </code>
      , due to the fact
that the
      <code class="leafygreen-ui-1l06pbn">
       numericOrdering
      </code>
      parameter does not support decimal
values.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      As a result,
      <code class="leafygreen-ui-1l06pbn">
       2.2
      </code>
      and
      <code class="leafygreen-ui-1l06pbn">
       2.10
      </code>
      are sorted in lexicographic order.
     </p>
    </li>
   </ul>
  </section>
 </section>
</section>
