<section>
 <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium">
  MongoDB Extended JSON (v1)
  <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-extended-json--v1-" title="Permalink to this heading">
   <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
    <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
    </path>
    <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
    </path>
   </svg>
   <div class="css-1btu0w3 evvkmar0" id="mongodb-extended-json--v1-">
   </div>
  </a>
 </h1>
 <div class="leafygreen-ui-a5yxub">
  <p class="css-1cmx2d4 ef7gu8j0">
   On this page
  </p>
  <ul class="css-1qb0mst ef7gu8j1">
   <li class="leafygreen-ui-1e7a0ei">
    <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#mongodb-extended-json-v1-and-mongodb-drivers" target="_self">
     <span>
      MongoDB Extended JSON v1 and MongoDB Drivers
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#parsers-and-supported-format" target="_self">
     <span>
      Parsers and Supported Format
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#bson-data-types-and-associated-representations" target="_self">
     <span>
      BSON Data Types and Associated Representations
     </span>
    </a>
   </li>
  </ul>
 </div>
 <div class="leafygreen-ui-85da11" role="note">
  <h2 class="leafygreen-ui-1ac4g5h">
   Important
  </h2>
  <h3 class="leafygreen-ui-144d5kf">
   <strong>
    Disambiguation
   </strong>
  </h3>
  <div class="leafygreen-ui-9mycqc">
   <p class="leafygreen-ui-1kp3ins">
    The following page discusses MongoDB Extended JSON v1 (Legacy
extended JSON). For discussion on MongoDB Extended JSON v2, see
    <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/">
     MongoDB Extended JSON (v2)
     <!-- -->
     .
    </a>
   </p>
   <p class="leafygreen-ui-1kp3ins">
    For supported data types in
    <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
     <code class="leafygreen-ui-1l06pbn">
      mongo
     </code>
    </a>
    , see
    <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/reference/data-types/" target="_self">
     <span>
      mongosh Data Types
      <!-- -->
      .
     </span>
    </a>
   </p>
  </div>
 </div>
 <p class="leafygreen-ui-1kp3ins">
  <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-JSON">
   JSON
  </a>
  can only represent a subset of the types supported by
  <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-BSON">
   BSON
  </a>
  . To preserve type information, MongoDB adds the following
extensions to the JSON format:
 </p>
 <ul class="leafygreen-ui-rioki0">
  <li class="leafygreen-ui-d7p7b6">
   <p class="leafygreen-ui-1kp3ins">
    <em>
     Strict mode
    </em>
    . Strict mode representations of BSON types conform to
the
    <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://www.json.org" rel="noopener noreferrer">
     <span>
      JSON RFC
     </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>
    . Any JSON parser can parse
these strict mode representations as key/value pairs; however, only
the MongoDB internal JSON parser recognizes the type
information conveyed by the format.
   </p>
  </li>
  <li class="leafygreen-ui-d7p7b6">
   <p class="leafygreen-ui-1kp3ins">
    <code class="leafygreen-ui-1l06pbn">
     mongo
    </code>
    <em>
     Shell mode
    </em>
    . The MongoDB internal JSON parser and the
    <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
     <code class="leafygreen-ui-1l06pbn">
      mongo
     </code>
    </a>
    shell can parse this mode.
   </p>
  </li>
 </ul>
 <p class="leafygreen-ui-1kp3ins">
  The representation used for the various data types depends on the
context in which the JSON is parsed.
 </p>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   MongoDB Extended JSON v1 and MongoDB Drivers
   <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-extended-json-v1-and-mongodb-drivers" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="mongodb-extended-json-v1-and-mongodb-drivers">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   The following drivers use the Extended JSON v1.0 (Legacy)
  </p>
  <ul class="leafygreen-ui-rioki0">
   <li class="leafygreen-ui-d7p7b6">
    <p class="leafygreen-ui-1kp3ins">
     C#
    </p>
   </li>
   <li class="leafygreen-ui-d7p7b6">
    <p class="leafygreen-ui-1kp3ins">
     Ruby
    </p>
   </li>
  </ul>
  <p class="leafygreen-ui-1kp3ins">
   For the other drivers, refer to
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongodb-extended-json/">
    MongoDB Extended JSON (v2)
    <!-- -->
    .
   </a>
  </p>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Parsers and Supported Format
   <a class="headerlink leafygreen-ui-1kepx47" href="#parsers-and-supported-format" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="parsers-and-supported-format">
    </div>
   </a>
  </h2>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Input in Strict Mode
    <a class="headerlink leafygreen-ui-1kepx47" href="#input-in-strict-mode" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="input-in-strict-mode">
     </div>
    </a>
   </h3>
   <p class="leafygreen-ui-1kp3ins">
    The following can parse representations in strict mode
    <em>
     with
    </em>
    recognition of the type information.
   </p>
   <ul class="leafygreen-ui-rioki0">
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongoimport/#mongodb-binary-bin.mongoimport" target="_self">
       <span>
        <code class="leafygreen-ui-1l06pbn">
         mongoimport
        </code>
       </span>
      </a>
      version 4.0 and earlier
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       --query
      </code>
      option of various MongoDB tools
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/products/compass" target="_self">
       <span>
        MongoDB Compass
       </span>
      </a>
     </p>
    </li>
   </ul>
   <p class="leafygreen-ui-1kp3ins">
    Other JSON parsers, including
    <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
     <code class="leafygreen-ui-1l06pbn">
      mongo
     </code>
    </a>
    shell, can parse
strict mode representations as key/value pairs, but
    <em>
     without
    </em>
    recognition of the type information.
   </p>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Input in
    <code class="leafygreen-ui-1l06pbn">
     mongo
    </code>
    Shell Mode
    <a class="headerlink leafygreen-ui-1kepx47" href="#input-in-mongo-shell-mode" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="input-in-mongo-shell-mode">
     </div>
    </a>
   </h3>
   <p class="leafygreen-ui-1kp3ins">
    The following can parse representations in
    <code class="leafygreen-ui-1l06pbn">
     mongo
    </code>
    shell mode
    <em>
     with
    </em>
    recognition of the type information.
   </p>
   <ul class="leafygreen-ui-rioki0">
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongoimport/#mongodb-binary-bin.mongoimport" target="_self">
       <span>
        <code class="leafygreen-ui-1l06pbn">
         mongoimport
        </code>
       </span>
      </a>
      version 4.0 and earlier
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       --query
      </code>
      option of various MongoDB tools
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
       <code class="leafygreen-ui-1l06pbn">
        mongo
       </code>
      </a>
      shell
     </p>
    </li>
   </ul>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Output in Strict mode
    <a class="headerlink leafygreen-ui-1kepx47" href="#output-in-strict-mode" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="output-in-strict-mode">
     </div>
    </a>
   </h3>
   <p class="leafygreen-ui-1kp3ins">
    Before version 4.2,
    <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/mongoexport/#mongodb-binary-bin.mongoexport" target="_self">
     <span>
      <code class="leafygreen-ui-1l06pbn">
       mongoexport
      </code>
     </span>
    </a>
    outputs data in
    <em>
     Strict mode
    </em>
    of MongoDB Extended JSON v1.
   </p>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Output in
    <code class="leafygreen-ui-1l06pbn">
     mongo
    </code>
    Shell Mode
    <a class="headerlink leafygreen-ui-1kepx47" href="#output-in-mongo-shell-mode" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="output-in-mongo-shell-mode">
     </div>
    </a>
   </h3>
   <p class="leafygreen-ui-1kp3ins">
    Before version 4.2,
    <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/database-tools/bsondump/#mongodb-binary-bin.bsondump" target="_self">
     <span>
      <code class="leafygreen-ui-1l06pbn">
       bsondump
      </code>
     </span>
    </a>
    outputs in
    <code class="leafygreen-ui-1l06pbn">
     mongo
    </code>
    <em>
     Shell
mode
    </em>
    .
   </p>
  </section>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   BSON Data Types and Associated Representations
   <a class="headerlink leafygreen-ui-1kepx47" href="#bson-data-types-and-associated-representations" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="bson-data-types-and-associated-representations">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   The following presents the BSON data types and the associated
representations in
   <em>
    Strict mode
   </em>
   and
   <code class="leafygreen-ui-1l06pbn">
    mongo
   </code>
   <em>
    Shell mode
   </em>
   .
  </p>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Binary
    <a class="headerlink leafygreen-ui-1kepx47" href="#binary" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="binary">
     </div>
    </a>
   </h3>
   <dl class="bsontype">
    <dt>
     <code class="leafygreen-ui-1l06pbn">
      data_binary
     </code>
     <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-bsontype-data_binary" title="Permalink to this definition">
      <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
       <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
       </path>
       <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
       </path>
      </svg>
      <div class="css-1btu0w3 evvkmar0" id="mongodb-bsontype-data_binary">
      </div>
     </a>
    </dt>
    <dd>
     <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>
            Strict Mode
           </div>
          </div>
         </th>
         <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
          <div class="leafygreen-ui-ui0te9">
           <div>
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
             <code class="leafygreen-ui-1l06pbn">
              mongo
             </code>
            </a>
            Shell Mode
           </div>
          </div>
         </th>
        </tr>
       </thead>
       <tbody>
        <tr class="">
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"$binary\": \"&lt;bindata&gt;\", \"$type\": \"&lt;t&gt;\" }"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-tyg50d">
               <pre class="leafygreen-ui-1agdxuk" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "$binary": "&lt;bindata&gt;", "$type": "&lt;t&gt;" }</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"BinData ( &lt;t&gt;, &lt;bindata&gt; )"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">BinData ( &lt;t&gt;, &lt;bindata&gt; )</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
    </dd>
   </dl>
   <p class="leafygreen-ui-1kp3ins">
    Where the values are as follows:
   </p>
   <ul class="leafygreen-ui-rioki0">
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       &lt;bindata&gt;
      </code>
      is the base64 representation of a binary string.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       &lt;t&gt;
      </code>
      is a representation of a single byte indicating the data type. In
      <em>
       Strict mode
      </em>
      it is a hexadecimal string, and in
      <em>
       Shell mode
      </em>
      it is an integer.
See the extended bson documentation.
      <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="http://bsonspec.org/spec.html" rel="noopener noreferrer">
       <span>
        http://bsonspec.org/spec.html
       </span>
       <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16">
        <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor">
        </path>
        <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor">
        </path>
       </svg>
      </a>
     </p>
    </li>
   </ul>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Date
    <a class="headerlink leafygreen-ui-1kepx47" href="#date" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="date">
     </div>
    </a>
   </h3>
   <dl class="bsontype">
    <dt>
     <code class="leafygreen-ui-1l06pbn">
      data_date
     </code>
     <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-bsontype-data_date" title="Permalink to this definition">
      <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
       <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
       </path>
       <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
       </path>
      </svg>
      <div class="css-1btu0w3 evvkmar0" id="mongodb-bsontype-data_date">
      </div>
     </a>
    </dt>
    <dd>
     <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>
            Strict Mode
           </div>
          </div>
         </th>
         <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
          <div class="leafygreen-ui-ui0te9">
           <div>
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
             <code class="leafygreen-ui-1l06pbn">
              mongo
             </code>
            </a>
            Shell Mode
           </div>
          </div>
         </th>
        </tr>
       </thead>
       <tbody>
        <tr class="">
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"$date\": \"&lt;date&gt;\" }"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "$date": "&lt;date&gt;" }</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"new Date ( &lt;date&gt; )"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">new Date ( &lt;date&gt; )</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <p class="leafygreen-ui-1kp3ins">
      In
      <em>
       Strict mode
      </em>
      ,
      <code class="leafygreen-ui-1l06pbn">
       &lt;date&gt;
      </code>
      is an ISO-8601 date format with a mandatory time
zone field following the template
      <code class="leafygreen-ui-1l06pbn">
       YYYY-MM-DDTHH:mm:ss.mmm&lt;+/-Offset&gt;
      </code>
      .
     </p>
     <p class="leafygreen-ui-1kp3ins">
      In
      <em>
       Shell mode
      </em>
      ,
      <code class="leafygreen-ui-1l06pbn">
       &lt;date&gt;
      </code>
      is the JSON representation of a 64-bit signed
integer giving the number of milliseconds since epoch UTC.
     </p>
    </dd>
   </dl>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Timestamp
    <a class="headerlink leafygreen-ui-1kepx47" href="#timestamp" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="timestamp">
     </div>
    </a>
   </h3>
   <dl class="bsontype">
    <dt>
     <code class="leafygreen-ui-1l06pbn">
      data_timestamp
     </code>
     <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-bsontype-data_timestamp" title="Permalink to this definition">
      <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
       <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
       </path>
       <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
       </path>
      </svg>
      <div class="css-1btu0w3 evvkmar0" id="mongodb-bsontype-data_timestamp">
      </div>
     </a>
    </dt>
    <dd>
     <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>
            Strict Mode
           </div>
          </div>
         </th>
         <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
          <div class="leafygreen-ui-ui0te9">
           <div>
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
             <code class="leafygreen-ui-1l06pbn">
              mongo
             </code>
            </a>
            Shell Mode
           </div>
          </div>
         </th>
        </tr>
       </thead>
       <tbody>
        <tr class="">
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"$timestamp\": { \"t\": &lt;t&gt;, \"i\": <i> } }</i>"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-tyg50d">
               <pre class="leafygreen-ui-1agdxuk" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "$timestamp": { "t": &lt;t&gt;, "i": &lt;i&gt; } }</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"Timestamp( &lt;t&gt;, <i> )</i>"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">Timestamp( &lt;t&gt;, &lt;i&gt; )</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
    </dd>
   </dl>
   <p class="leafygreen-ui-1kp3ins">
    Where the values are as follows:
   </p>
   <ul class="leafygreen-ui-rioki0">
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       &lt;t&gt;
      </code>
      is the JSON representation of a 32-bit unsigned integer for
seconds since epoch.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       &lt;i&gt;
      </code>
      is a 32-bit unsigned integer for the increment.
     </p>
    </li>
   </ul>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Regular Expression
    <a class="headerlink leafygreen-ui-1kepx47" href="#regular-expression" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="regular-expression">
     </div>
    </a>
   </h3>
   <dl class="bsontype">
    <dt>
     <code class="leafygreen-ui-1l06pbn">
      data_regex
     </code>
     <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-bsontype-data_regex" title="Permalink to this definition">
      <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
       <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
       </path>
       <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
       </path>
      </svg>
      <div class="css-1btu0w3 evvkmar0" id="mongodb-bsontype-data_regex">
      </div>
     </a>
    </dt>
    <dd>
     <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>
            Strict Mode
           </div>
          </div>
         </th>
         <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
          <div class="leafygreen-ui-ui0te9">
           <div>
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
             <code class="leafygreen-ui-1l06pbn">
              mongo
             </code>
            </a>
            Shell Mode
           </div>
          </div>
         </th>
        </tr>
       </thead>
       <tbody>
        <tr class="">
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"$regex\": \"&lt;sregex&gt;\", \"$options\": \"&lt;soptions&gt;\" }"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-tyg50d">
               <pre class="leafygreen-ui-1agdxuk" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "$regex": "&lt;sRegex&gt;", "$options": "&lt;sOptions&gt;" }</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"/&lt;jregex&gt;/&lt;joptions&gt;"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">/&lt;jRegex&gt;/&lt;jOptions&gt;</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
    </dd>
   </dl>
   <p class="leafygreen-ui-1kp3ins">
    Where the values are as follows:
   </p>
   <ul class="leafygreen-ui-rioki0">
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       &lt;sRegex&gt;
      </code>
      is a string of valid JSON characters.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       &lt;jRegex&gt;
      </code>
      is a string that may contain valid JSON characters and
unescaped double quote (
      <code class="leafygreen-ui-1l06pbn">
       "
      </code>
      ) characters, but may not contain
unescaped forward slash (
      <code class="leafygreen-ui-1l06pbn">
       /
      </code>
      ) characters.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       &lt;sOptions&gt;
      </code>
      is a string containing the regex options represented
by the letters of the alphabet.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       &lt;jOptions&gt;
      </code>
      is a string that may contain only the characters 'g',
'i', 'm' and 's' (added in v1.9). Because the
      <code class="leafygreen-ui-1l06pbn">
       JavaScript
      </code>
      and
      <code class="leafygreen-ui-1l06pbn">
       mongo Shell
      </code>
      representations support a limited range of options,
any nonconforming options will be dropped when converting to this
representation.
     </p>
    </li>
   </ul>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    OID
    <a class="headerlink leafygreen-ui-1kepx47" href="#oid" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="oid">
     </div>
    </a>
   </h3>
   <dl class="bsontype">
    <dt>
     <code class="leafygreen-ui-1l06pbn">
      data_oid
     </code>
     <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-bsontype-data_oid" title="Permalink to this definition">
      <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
       <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
       </path>
       <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
       </path>
      </svg>
      <div class="css-1btu0w3 evvkmar0" id="mongodb-bsontype-data_oid">
      </div>
     </a>
    </dt>
    <dd>
     <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>
            Strict Mode
           </div>
          </div>
         </th>
         <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
          <div class="leafygreen-ui-ui0te9">
           <div>
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
             <code class="leafygreen-ui-1l06pbn">
              mongo
             </code>
            </a>
            Shell Mode
           </div>
          </div>
         </th>
        </tr>
       </thead>
       <tbody>
        <tr class="">
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"$oid\": \"&lt;id&gt;\" }"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "$oid": "&lt;id&gt;" }</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"ObjectId( \"&lt;id&gt;\" )"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">ObjectId( "&lt;id&gt;" )</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
    </dd>
   </dl>
   <p class="leafygreen-ui-1kp3ins">
    Where the values are as follows:
   </p>
   <ul class="leafygreen-ui-rioki0">
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       &lt;id&gt;
      </code>
      is a 24-character hexadecimal string.
     </p>
    </li>
   </ul>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    DB Reference
    <a class="headerlink leafygreen-ui-1kepx47" href="#db-reference" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="db-reference">
     </div>
    </a>
   </h3>
   <dl class="bsontype">
    <dt>
     <code class="leafygreen-ui-1l06pbn">
      data_ref
     </code>
     <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-bsontype-data_ref" title="Permalink to this definition">
      <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
       <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
       </path>
       <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
       </path>
      </svg>
      <div class="css-1btu0w3 evvkmar0" id="mongodb-bsontype-data_ref">
      </div>
     </a>
    </dt>
    <dd>
     <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>
            Strict Mode
           </div>
          </div>
         </th>
         <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
          <div class="leafygreen-ui-ui0te9">
           <div>
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
             <code class="leafygreen-ui-1l06pbn">
              mongo
             </code>
            </a>
            Shell Mode
           </div>
          </div>
         </th>
        </tr>
       </thead>
       <tbody>
        <tr class="">
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"$ref\": \"&lt;name&gt;\", \"$id\": \"&lt;id&gt;\" }"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-tyg50d">
               <pre class="leafygreen-ui-1agdxuk" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "$ref": "&lt;name&gt;", "$id": "&lt;id&gt;" }</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"DBRef(\"&lt;name&gt;\", \"&lt;id&gt;\")"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">DBRef("&lt;name&gt;", "&lt;id&gt;")</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
    </dd>
   </dl>
   <p class="leafygreen-ui-1kp3ins">
    Where the values are as follows:
   </p>
   <ul class="leafygreen-ui-rioki0">
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       &lt;name&gt;
      </code>
      is a string of valid JSON characters.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       &lt;id&gt;
      </code>
      is any valid extended JSON type.
     </p>
    </li>
   </ul>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Undefined Type
    <a class="headerlink leafygreen-ui-1kepx47" href="#undefined-type" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="undefined-type">
     </div>
    </a>
   </h3>
   <dl class="bsontype">
    <dt>
     <code class="leafygreen-ui-1l06pbn">
      data_undefined
     </code>
     <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-bsontype-data_undefined" title="Permalink to this definition">
      <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
       <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
       </path>
       <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
       </path>
      </svg>
      <div class="css-1btu0w3 evvkmar0" id="mongodb-bsontype-data_undefined">
      </div>
     </a>
    </dt>
    <dd>
     <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>
            Strict Mode
           </div>
          </div>
         </th>
         <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
          <div class="leafygreen-ui-ui0te9">
           <div>
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
             <code class="leafygreen-ui-1l06pbn">
              mongo
             </code>
            </a>
            Shell Mode
           </div>
          </div>
         </th>
        </tr>
       </thead>
       <tbody>
        <tr class="">
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"$undefined\": true }"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "$undefined": true }</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"undefined"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">undefined</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <p class="leafygreen-ui-1kp3ins">
      The representation for the JavaScript/BSON undefined type.
     </p>
     <p class="leafygreen-ui-1kp3ins">
      You
      <em>
       cannot
      </em>
      use
      <code class="leafygreen-ui-1l06pbn">
       undefined
      </code>
      in query documents.
Consider the following document inserted into the
      <code class="leafygreen-ui-1l06pbn">
       people
      </code>
      collection using the legacy
      <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
       <code class="leafygreen-ui-1l06pbn">
        mongo
       </code>
      </a>
      shell:
     </p>
     <script class="structured_data" type="application/ld+json">
      {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.people.insertOne( { name : \"Sally\", age : undefined } )","programmingLanguage":"Bash"}
     </script>
     <div class="css-16lmvu9">
      <div class="leafygreen-ui-196mwvg">
       <div class="leafygreen-ui-1b1bvay">
        <pre class="leafygreen-ui-1q4bxgx" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.people.insertOne( { name : <span class="lg-highlight-string">"Sally"</span>, age : undefined } )</td></tr></tbody></table></code></pre>
        <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
         <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
          <div class="leafygreen-ui-xhlipt">
           <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
            <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
            </path>
           </svg>
          </div>
         </button>
        </div>
       </div>
      </div>
     </div>
     <p class="leafygreen-ui-1kp3ins">
      The following queries return an error:
     </p>
     <script class="structured_data" type="application/ld+json">
      {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.people.find( { age : undefined } )\ndb.people.find( { age : { $gte : undefined } } )","programmingLanguage":"Bash"}
     </script>
     <div class="css-16lmvu9">
      <div class="leafygreen-ui-196mwvg">
       <div class="leafygreen-ui-yzcs8i">
        <pre class="leafygreen-ui-11itue3" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.people.find( { age : undefined } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.people.find( { age : { <span class="lg-highlight-variable">$gte</span> : undefined } } )</td></tr></tbody></table></code></pre>
        <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
         <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
          <div class="leafygreen-ui-xhlipt">
           <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
            <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 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, you can query for undefined values using
      <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/operator/query/type/#mongodb-query-op.-type">
       <code class="leafygreen-ui-1l06pbn">
        $type
       </code>
      </a>
      , as
in:
     </p>
     <script class="structured_data" type="application/ld+json">
      {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.people.find( { age : { $type : 6 } } )","programmingLanguage":"Bash"}
     </script>
     <div class="css-16lmvu9">
      <div class="leafygreen-ui-196mwvg">
       <div class="leafygreen-ui-yzcs8i">
        <pre class="leafygreen-ui-1q4bxgx" tabindex="-1"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.people.find( { age : { <span class="lg-highlight-variable">$type</span> : 6 } } )</td></tr></tbody></table></code></pre>
        <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
         <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
          <div class="leafygreen-ui-xhlipt">
           <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
            <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
            </path>
           </svg>
          </div>
         </button>
        </div>
       </div>
      </div>
     </div>
     <p class="leafygreen-ui-1kp3ins">
      This query returns all documents for which the
      <code class="leafygreen-ui-1l06pbn">
       age
      </code>
      field has
value
      <code class="leafygreen-ui-1l06pbn">
       undefined
      </code>
      .
     </p>
     <div class="leafygreen-ui-85da11" role="note">
      <h2 class="leafygreen-ui-1ac4g5h">
       Important
      </h2>
      <div class="leafygreen-ui-9mycqc">
       <p class="leafygreen-ui-1kp3ins">
        The undefined BSON type is
        <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://bsonspec.org/spec.html" rel="noopener noreferrer">
         <span>
          deprecated
         </span>
         <svg alt="" aria-hidden="true" class="leafygreen-ui-1ie5kuq" height="16" role="presentation" viewbox="0 0 16 16" width="16">
          <path d="M13.823 2.4491C13.8201 2.30008 13.6999 2.17994 13.5509 2.17704L9.5062 2.09836C9.25654 2.09351 9.12821 2.39519 9.30482 2.5718L10.3856 3.65257L7.93433 6.10383C7.87964 6.15852 7.83047 6.21665 7.78683 6.27752L5.99909 8.06525C5.46457 8.59977 5.46457 9.4664 5.99909 10.0009C6.53361 10.5354 7.40023 10.5354 7.93475 10.0009L9.72249 8.21317C9.78336 8.16953 9.84148 8.12037 9.89618 8.06567L12.3474 5.61441L13.4282 6.69518C13.6048 6.87179 13.9065 6.74347 13.9016 6.4938L13.823 2.4491Z" fill="currentColor">
          </path>
          <path d="M7.25 3.12893C7.66421 3.12893 8 3.46472 8 3.87893C8 4.29315 7.66421 4.62893 7.25 4.62893H4C3.72386 4.62893 3.5 4.85279 3.5 5.12893V11.9929C3.5 12.2691 3.72386 12.4929 4 12.4929H10.864C11.1401 12.4929 11.364 12.2691 11.364 11.9929V8.75C11.364 8.33579 11.6998 8 12.114 8C12.5282 8 12.864 8.33579 12.864 8.75V11.9929C12.864 13.0975 11.9686 13.9929 10.864 13.9929H4C2.89543 13.9929 2 13.0975 2 11.9929V5.12893C2 4.02436 2.89543 3.12893 4 3.12893H7.25Z" fill="currentColor">
          </path>
         </svg>
        </a>
        .
        <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self">
         <span>
          <code class="leafygreen-ui-1l06pbn">
           mongosh
          </code>
         </span>
        </a>
        stores
a null value instead.
       </p>
       <p class="leafygreen-ui-1kp3ins">
        For example, use the same code to insert a document in
        <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self">
         <span>
          <code class="leafygreen-ui-1l06pbn">
           mongosh
          </code>
         </span>
        </a>
        and in the legacy
        <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
         <code class="leafygreen-ui-1l06pbn">
          mongo
         </code>
        </a>
        shell:
       </p>
       <script class="structured_data" type="application/ld+json">
        {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.people.insertOne( { name : \"Sally\", age : undefined } )","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">people</span>.<span class="lg-highlight-title lg-highlight-function">insertOne</span>( <!-- -->{ <!-- -->name <!-- -->: <span class="lg-highlight-string">"Sally"</span>, <!-- -->age <!-- -->: <span class="lg-highlight-literal">undefined</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 resulting documents are different:
       </p>
       <script class="structured_data" type="application/ld+json">
        {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"name\" : \"Sally\", \"age\" : null }\n{ \"name\" : \"Sally\", \"age\" : undefined }"}
       </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">{ "name" : "Sally", "age" : null }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ "name" : "Sally", "age" : undefined }</td></tr></tbody></table></code></pre>
          <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
           <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
            <div class="leafygreen-ui-xhlipt">
             <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
              <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 7 14.2325 7 13.2857V12Z" fill="currentColor" fill-rule="evenodd">
              </path>
             </svg>
            </div>
           </button>
          </div>
         </div>
        </div>
       </div>
      </div>
     </div>
    </dd>
   </dl>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    MinKey
    <a class="headerlink leafygreen-ui-1kepx47" href="#minkey" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="minkey">
     </div>
    </a>
   </h3>
   <dl class="bsontype">
    <dt>
     <code class="leafygreen-ui-1l06pbn">
      data_minkey
     </code>
     <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-bsontype-data_minkey" title="Permalink to this definition">
      <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
       <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
       </path>
       <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
       </path>
      </svg>
      <div class="css-1btu0w3 evvkmar0" id="mongodb-bsontype-data_minkey">
      </div>
     </a>
    </dt>
    <dd>
     <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>
            Strict Mode
           </div>
          </div>
         </th>
         <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
          <div class="leafygreen-ui-ui0te9">
           <div>
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
             <code class="leafygreen-ui-1l06pbn">
              mongo
             </code>
            </a>
            Shell Mode
           </div>
          </div>
         </th>
        </tr>
       </thead>
       <tbody>
        <tr class="">
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"$minKey\": 1 }"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "$minKey": 1 }</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"MinKey"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">MinKey</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <p class="leafygreen-ui-1kp3ins">
      The representation of the MinKey BSON data type that compares lower
than all other types. See
      <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-type-comparison-order/#std-label-faq-dev-compare-order-for-BSON-types">
       Comparison/Sort Order
      </a>
      for more information on
comparison order for BSON types.
     </p>
    </dd>
   </dl>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    MaxKey
    <a class="headerlink leafygreen-ui-1kepx47" href="#maxkey" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="maxkey">
     </div>
    </a>
   </h3>
   <dl class="bsontype">
    <dt>
     <code class="leafygreen-ui-1l06pbn">
      data_maxkey
     </code>
     <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-bsontype-data_maxkey" title="Permalink to this definition">
      <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
       <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
       </path>
       <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
       </path>
      </svg>
      <div class="css-1btu0w3 evvkmar0" id="mongodb-bsontype-data_maxkey">
      </div>
     </a>
    </dt>
    <dd>
     <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>
            Strict Mode
           </div>
          </div>
         </th>
         <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
          <div class="leafygreen-ui-ui0te9">
           <div>
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
             <code class="leafygreen-ui-1l06pbn">
              mongo
             </code>
            </a>
            Shell Mode
           </div>
          </div>
         </th>
        </tr>
       </thead>
       <tbody>
        <tr class="">
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"$maxKey\": 1 }"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "$maxKey": 1 }</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"MaxKey"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">MaxKey</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <p class="leafygreen-ui-1kp3ins">
      The representation of the MaxKey BSON data type that compares higher
than all other types. See
      <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/bson-type-comparison-order/#std-label-faq-dev-compare-order-for-BSON-types">
       Comparison/Sort Order
      </a>
      for more information on
comparison order for BSON types.
     </p>
    </dd>
   </dl>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    NumberLong
    <a class="headerlink leafygreen-ui-1kepx47" href="#numberlong" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="numberlong">
     </div>
    </a>
   </h3>
   <dl class="bsontype">
    <dt>
     <code class="leafygreen-ui-1l06pbn">
      data_numberlong
     </code>
     <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-bsontype-data_numberlong" title="Permalink to this definition">
      <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
       <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
       </path>
       <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
       </path>
      </svg>
      <div class="css-1btu0w3 evvkmar0" id="mongodb-bsontype-data_numberlong">
      </div>
     </a>
    </dt>
    <dd>
     <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>
            Strict Mode
           </div>
          </div>
         </th>
         <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
          <div class="leafygreen-ui-ui0te9">
           <div>
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
             <code class="leafygreen-ui-1l06pbn">
              mongo
             </code>
            </a>
            Shell Mode
           </div>
          </div>
         </th>
        </tr>
       </thead>
       <tbody>
        <tr class="">
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"$numberLong\": \"&lt;number&gt;\" }"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "$numberLong": "&lt;number&gt;" }</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"NumberLong( \"&lt;number&gt;\" )"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">NumberLong( "&lt;number&gt;" )</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       NumberLong
      </code>
      is a 64 bit signed integer. In the legacy
      <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
       <code class="leafygreen-ui-1l06pbn">
        mongo
       </code>
      </a>
      shell, you must use quotation marks to insert a
      <code class="leafygreen-ui-1l06pbn">
       NumberLong
      </code>
      or the operation will produce an error.
     </p>
     <p class="leafygreen-ui-1kp3ins">
      For example, the following commands attempt to insert
      <code class="leafygreen-ui-1l06pbn">
       9223372036854775807
      </code>
      as a
      <code class="leafygreen-ui-1l06pbn">
       NumberLong
      </code>
      with and without
quotation marks around the integer value:
     </p>
     <script class="structured_data" type="application/ld+json">
      {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.json.insertOne( { longQuoted : NumberLong(\"9223372036854775807\") } )\ndb.json.insertOne( { longUnQuoted : NumberLong(9223372036854775807) } )","programmingLanguage":"Bash"}
     </script>
     <div class="css-16lmvu9">
      <div class="leafygreen-ui-196mwvg">
       <div class="leafygreen-ui-1b1bvay">
        <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.json.insertOne( { longQuoted : NumberLong(<span class="lg-highlight-string">"9223372036854775807"</span>) } )</td></tr><tr class="leafygreen-ui-1wr1lm6"><td class="leafygreen-ui-7razhx">db.json.insertOne( { longUnQuoted : NumberLong(9223372036854775807) } )</td></tr></tbody></table></code></pre>
        <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
         <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
          <div class="leafygreen-ui-xhlipt">
           <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
            <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 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 highlighted line produces an error in the legacy
      <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
       <code class="leafygreen-ui-1l06pbn">
        mongo
       </code>
      </a>
      shell. The insert succeeds in
      <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self">
       <span>
        <code class="leafygreen-ui-1l06pbn">
         mongosh
        </code>
        .
       </span>
      </a>
     </p>
    </dd>
   </dl>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    NumberDecimal
    <a class="headerlink leafygreen-ui-1kepx47" href="#numberdecimal" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="numberdecimal">
     </div>
    </a>
   </h3>
   <dl class="bsontype">
    <dt>
     <code class="leafygreen-ui-1l06pbn">
      data_numberdecimal
     </code>
     <a class="headerlink leafygreen-ui-1kepx47" href="#mongodb-bsontype-data_numberdecimal" title="Permalink to this definition">
      <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
       <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
       </path>
       <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
       </path>
      </svg>
      <div class="css-1btu0w3 evvkmar0" id="mongodb-bsontype-data_numberdecimal">
      </div>
     </a>
    </dt>
    <dd>
     <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>
            Strict Mode
           </div>
          </div>
         </th>
         <th class="leafygreen-ui-13uteka" role="columnheader" scope="col">
          <div class="leafygreen-ui-ui0te9">
           <div>
            <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/mongo/#mongodb-binary-bin.mongo">
             <code class="leafygreen-ui-1l06pbn">
              mongo
             </code>
            </a>
            Shell Mode
           </div>
          </div>
         </th>
        </tr>
       </thead>
       <tbody>
        <tr class="">
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"{ \"$numberDecimal\": \"&lt;number&gt;\" }"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-tyg50d">
               <pre class="leafygreen-ui-1agdxuk" tabindex="0"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">{ "$numberDecimal": "&lt;number&gt;" }</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
         <td class="leafygreen-ui-1drjk7h">
          <div class="leafygreen-ui-1n4j8xf">
           <div>
            <script class="structured_data" type="application/ld+json">
             {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"NumberDecimal( \"&lt;number&gt;\" )"}
            </script>
            <div class="css-1lju8ps">
             <div class="leafygreen-ui-196mwvg">
              <div class="leafygreen-ui-1jheeh3">
               <pre class="leafygreen-ui-1agdxuk" tabindex="-1"><code class="lg-highlight-hljs-light none leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">NumberDecimal( "&lt;number&gt;" )</td></tr></tbody></table></code></pre>
              </div>
             </div>
            </div>
           </div>
          </div>
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <p class="leafygreen-ui-1kp3ins">
      <code class="leafygreen-ui-1l06pbn">
       NumberDecimal
      </code>
      is a
      <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://github.com/mongodb/specifications/blob/master/source/bson-decimal128/decimal128.rst" rel="noopener noreferrer">
       <span>
        high-precision decimal
       </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>
      . You must include quotation marks, or the
input number will be treated as a double, resulting in data loss.
     </p>
     <p class="leafygreen-ui-1kp3ins">
      For example, the following commands insert
      <code class="leafygreen-ui-1l06pbn">
       123.40
      </code>
      as a
      <code class="leafygreen-ui-1l06pbn">
       NumberDecimal
      </code>
      with and without quotation marks around the value:
     </p>
     <script class="structured_data" type="application/ld+json">
      {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.json.insertOne( { decimalQuoted : NumberDecimal(\"123.40\") } )\ndb.json.insertOne( { decimalUnQuoted : NumberDecimal(123.40) } )","programmingLanguage":"Bash"}
     </script>
     <div class="css-16lmvu9">
      <div class="leafygreen-ui-196mwvg">
       <div class="leafygreen-ui-1b1bvay">
        <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.json.insertOne( { decimalQuoted : NumberDecimal(<span class="lg-highlight-string">"123.40"</span>) } )</td></tr><tr class=""><td class="leafygreen-ui-7razhx">db.json.insertOne( { decimalUnQuoted : NumberDecimal(123.40) } )</td></tr></tbody></table></code></pre>
        <div class="leafygreen-ui-1bqcprk" data-testid="leafygreen-code-panel">
         <button aria-disabled="false" aria-label="Copy" class="leafygreen-ui-1c6zwke" data-testid="code_copy-button" tabindex="0">
          <div class="leafygreen-ui-xhlipt">
           <svg aria-label="Copy Icon" class="leafygreen-ui-1st74h4" height="16" role="img" viewbox="0 0 16 16" width="16">
            <path clip-rule="evenodd" d="M1 5.71428V10.2857C1 11.2325 1.76751 12 2.71429 12H5.75V7.10957C5.75 6.54414 5.97724 6.00244 6.38065 5.60623L8.67403 3.35381C8.77447 3.25516 8.88376 3.16757 9 3.09182V2.71429C9 1.76751 8.23249 1 7.28571 1H5.8V4.42857C5.8 5.13865 5.22437 5.71428 4.51429 5.71428H1ZM9 4.78571L7.25654 6.49804C7.24689 6.50752 7.23749 6.5172 7.22834 6.52708C7.22208 6.53383 7.21594 6.54068 7.20991 6.54762C7.07504 6.70295 7 6.90234 7 7.10957V7.79762H9H10.0095C10.4829 7.79762 10.8667 7.41386 10.8667 6.94047V4H10.1505C9.92587 4 9.7102 4.0882 9.54992 4.24562L9 4.78571ZM4.86667 1H4.15053C3.92587 1 3.7102 1.0882 3.54992 1.24562L1.25654 3.49804C1.09244 3.65921 1 3.87957 1 4.10957V4.79762H4.00952C4.48291 4.79762 4.86667 4.41386 4.86667 3.94047V1ZM7 12V8.71428H9H10.5143C11.2244 8.71428 11.8 8.13865 11.8 7.42857V4H13.2857C14.2325 4 15 4.76751 15 5.71429V13.2857C15 14.2325 14.2325 15 13.2857 15H8.71429C7.76751 15 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 you retrieve the documents, the value of
      <code class="leafygreen-ui-1l06pbn">
       decimalUnQuoted
      </code>
      has
changed, while
      <code class="leafygreen-ui-1l06pbn">
       decimalQuoted
      </code>
      retains its specified precision:
     </p>
     <script class="structured_data" type="application/ld+json">
      {"@context":"https://schema.org","@type":"SoftwareSourceCode","codeSampleType":"code snippet","text":"db.json.find()\n{ \"_id\" : ObjectId(\"596f88b7b613bb04f80a1ea9\"), \"decimalQuoted\" : NumberDecimal(\"123.40\") }\n{ \"_id\" : ObjectId(\"596f88c9b613bb04f80a1eaa\"), \"decimalUnQuoted\" : NumberDecimal(\"123.400000000000\") }","programmingLanguage":"Bash"}
     </script>
     <div class="css-16lmvu9">
      <div class="leafygreen-ui-196mwvg">
       <div class="leafygreen-ui-1b1bvay">
        <pre class="leafygreen-ui-11itue3" tabindex="0"><code class="lg-highlight-hljs-light bash leafygreen-ui-9ybzas"><table class="leafygreen-ui-1tr4g10"><tbody><tr class=""><td class="leafygreen-ui-7razhx">db.json.<span class="lg-highlight-title lg-highlight-function">find</span>()</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> : ObjectId(<span class="lg-highlight-string">"596f88b7b613bb04f80a1ea9"</span>), <span class="lg-highlight-string">"decimalQuoted"</span> : NumberDecimal(<span class="lg-highlight-string">"123.40"</span>) }</td></tr><tr class=""><td class="leafygreen-ui-7razhx">{ <span class="lg-highlight-string">"_id"</span> : ObjectId(<span class="lg-highlight-string">"596f88c9b613bb04f80a1eaa"</span>), <span class="lg-highlight-string">"decimalUnQuoted"</span> : NumberDecimal(<span class="lg-highlight-string">"123.400000000000"</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">
        This insert behavior is different in
        <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self">
         <span>
          <code class="leafygreen-ui-1l06pbn">
           mongosh
          </code>
          .
         </span>
        </a>
       </p>
       <p class="leafygreen-ui-1kp3ins">
        The quoted string format,
        <code class="leafygreen-ui-1l06pbn">
         NumberDecimal("123.40")
        </code>
        , is
deprecated. The insert succeeds, but also produces a warning.
       </p>
       <p class="leafygreen-ui-1kp3ins">
        The unquoted string format,
        <code class="leafygreen-ui-1l06pbn">
         NumberDecimal(123.40)
        </code>
        ,
stores the value as
        <code class="leafygreen-ui-1l06pbn">
         123.4
        </code>
        . The trailing
        <code class="leafygreen-ui-1l06pbn">
         0
        </code>
        is dropped.
       </p>
      </div>
     </div>
    </dd>
   </dl>
  </section>
 </section>
</section>
