<section>
 <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium">
  Explicit Encryption
  <a class="headerlink leafygreen-ui-1kepx47" href="#explicit-encryption" title="Permalink to this heading">
   <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
    <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
    </path>
    <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
    </path>
   </svg>
   <div class="css-1btu0w3 evvkmar0" id="explicit-encryption">
   </div>
  </a>
 </h1>
 <div class="leafygreen-ui-a5yxub">
  <p class="css-1cmx2d4 ef7gu8j0">
   On this page
  </p>
  <ul class="css-1qb0mst ef7gu8j1">
   <li class="leafygreen-ui-1e7a0ei">
    <a class="lg-ui-0001 leafygreen-ui-e98ikf" href="#overview" target="_self">
     <span>
      Overview
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#use-explicit-encryption" target="_self">
     <span>
      Use Explicit Encryption
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#create-a-clientencryption-instance" target="_self">
     <span>
      Create a ClientEncryption Instance
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#encrypt-fields-in-read-and-write-operations" target="_self">
     <span>
      Encrypt Fields in Read and Write Operations
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-x9koo9" href="#automatic-decryption" target="_self">
     <span>
      Automatic Decryption
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#server-side-field-level-encryption-enforcement" target="_self">
     <span>
      Server-Side Field Level Encryption Enforcement
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#learn-more" target="_self">
     <span>
      Learn More
     </span>
    </a>
   </li>
  </ul>
 </div>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Overview
   <a class="headerlink leafygreen-ui-1kepx47" href="#overview" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="overview">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   Explicit encryption provides fine-grained control over security, at
the cost of increased complexity when configuring collections and
writing code for MongoDB Drivers. With explicit encryption, you specify how
to encrypt fields in your document for each operation you
perform on the database, and you include this logic throughout your application.
  </p>
  <p class="leafygreen-ui-1kp3ins">
   Explicit encryption is available in the following MongoDB products:
  </p>
  <ul class="leafygreen-ui-rioki0">
   <li class="leafygreen-ui-d7p7b6">
    <p class="leafygreen-ui-1kp3ins">
     MongoDB Community Server
    </p>
   </li>
   <li class="leafygreen-ui-d7p7b6">
    <p class="leafygreen-ui-1kp3ins">
     MongoDB Enterprise Advanced
    </p>
   </li>
   <li class="leafygreen-ui-d7p7b6">
    <p class="leafygreen-ui-1kp3ins">
     MongoDB Atlas
    </p>
   </li>
  </ul>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Use Explicit Encryption
   <a class="headerlink leafygreen-ui-1kepx47" href="#use-explicit-encryption" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="use-explicit-encryption">
    </div>
   </a>
  </h2>
  <span class="leafygreen-ui-1qnjd6d" id="std-label-qe-fundamentals-manual-encryption-client-enc">
  </span>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Create a ClientEncryption Instance
    <a class="headerlink leafygreen-ui-1kepx47" href="#create-a-clientencryption-instance" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="create-a-clientencryption-instance">
     </div>
    </a>
   </h3>
   <p class="leafygreen-ui-1kp3ins">
    <code class="leafygreen-ui-1l06pbn">
     ClientEncryption
    </code>
    is an abstraction used across drivers and
    <a class="lg-ui-0001 leafygreen-ui-fgcsv5" href="https://www.mongodb.com/docs/mongodb-shell/#mongodb-binary-bin.mongosh" target="_self">
     <span>
      <code class="leafygreen-ui-1l06pbn">
       mongosh
      </code>
     </span>
    </a>
    that encapsulates the Key Vault collection
and
    <span class="leafygreen-ui-vm4wms" tabindex="0">
     KMS
    </span>
    operations involved in explicit encryption.
   </p>
   <p class="leafygreen-ui-1kp3ins">
    To create a
    <code class="leafygreen-ui-1l06pbn">
     ClientEncryption
    </code>
    instance, specify:
   </p>
   <ul class="leafygreen-ui-rioki0">
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      A
      <code class="leafygreen-ui-1l06pbn">
       kmsProviders
      </code>
      object configured with access to the
      <span class="leafygreen-ui-vm4wms" tabindex="0">
       KMS
      </span>
      provider hosting your Customer Master Key
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      The namespace of your Key Vault collection
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      If you use MongoDB Community Server, set the
      <code class="leafygreen-ui-1l06pbn">
       bypassQueryAnalysis
      </code>
      option to
      <code class="leafygreen-ui-1l06pbn">
       True
      </code>
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      A
      <code class="leafygreen-ui-1l06pbn">
       MongoClient
      </code>
      instance with access to your Key Vault collection
     </p>
    </li>
   </ul>
   <p class="leafygreen-ui-1kp3ins">
    For more
    <code class="leafygreen-ui-1l06pbn">
     ClientEncryption
    </code>
    options, see
    <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/reference/qe-options-clients/#std-label-qe-reference-mongo-client">
     MongoClient Options for Queryable Encryption
     <!-- -->
     .
    </a>
   </p>
   <span class="leafygreen-ui-1qnjd6d" id="std-label-qe-fundamentals-manual-encryption-update-operations">
   </span>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Encrypt Fields in Read and Write Operations
    <a class="headerlink leafygreen-ui-1kepx47" href="#encrypt-fields-in-read-and-write-operations" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="encrypt-fields-in-read-and-write-operations">
     </div>
    </a>
   </h3>
   <p class="leafygreen-ui-1kp3ins">
    You must update read and write operations throughout your application
such that your application encrypts fields before performing
read and write operations.
   </p>
   <p class="leafygreen-ui-1kp3ins">
    To encrypt fields, use the
    <code class="leafygreen-ui-1l06pbn">
     encrypt
    </code>
    method of your
    <code class="leafygreen-ui-1l06pbn">
     ClientEncryption
    </code>
    instance. Specify the following:
   </p>
   <ul class="leafygreen-ui-rioki0">
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      The value to be encrypted
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      The algorithm used:
      <code class="leafygreen-ui-1l06pbn">
       Indexed
      </code>
      ,
      <code class="leafygreen-ui-1l06pbn">
       Unindexed
      </code>
      , or
      <code class="leafygreen-ui-1l06pbn">
       Range
      </code>
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      The ID of the Data Encryption Key
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      The
      <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/encrypt-and-query/#std-label-qe-contention">
       contention factor
      </a>
      (if you are using the
      <code class="leafygreen-ui-1l06pbn">
       Indexed
      </code>
      or
      <code class="leafygreen-ui-1l06pbn">
       Range
      </code>
      algorithm)
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      If you are performing a read operation using the
      <code class="leafygreen-ui-1l06pbn">
       Indexed
      </code>
      or
      <code class="leafygreen-ui-1l06pbn">
       Range
      </code>
      algorithm, set the query type defined for your field.
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      The
      <code class="leafygreen-ui-1l06pbn">
       range
      </code>
      options
      <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/encrypt-and-query/#std-label-qe-field-min-max">
       min, max
      </a>
      (if you
are using the
      <code class="leafygreen-ui-1l06pbn">
       Range
      </code>
      algorithm)
     </p>
    </li>
   </ul>
   <div class="leafygreen-ui-15mdk4" role="note">
    <h2 class="leafygreen-ui-6n7b7d">
     Note
    </h2>
    <h3 class="leafygreen-ui-144d5kf">
     <strong>
      Query Types
     </strong>
    </h3>
    <div class="leafygreen-ui-9mycqc">
     <p class="leafygreen-ui-1kp3ins">
      The query type only applies to read operations.
     </p>
     <p class="leafygreen-ui-1kp3ins">
      To learn more about query types, see
      <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/encrypt-and-query/#std-label-qe-query-types">
       Supported Query Types and Behavior
       <!-- -->
       .
      </a>
     </p>
    </div>
   </div>
   <span class="leafygreen-ui-1qnjd6d" id="std-label-qe-fundamentals-man-enc-algorithm-choice">
   </span>
   <section>
    <h4 class="contains-headerlink leafygreen-ui-1vzlt5f">
     Algorithm Choice
     <a class="headerlink leafygreen-ui-1kepx47" href="#algorithm-choice" title="Permalink to this heading">
      <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
       <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
       </path>
       <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
       </path>
      </svg>
      <div class="css-1btu0w3 evvkmar0" id="algorithm-choice">
      </div>
     </a>
    </h4>
    <p class="leafygreen-ui-1kp3ins">
     Use the
     <code class="leafygreen-ui-1l06pbn">
      Indexed
     </code>
     or
     <code class="leafygreen-ui-1l06pbn">
      Range
     </code>
     algorithm if you specify a
     <code class="leafygreen-ui-1l06pbn">
      queryType
     </code>
     on the field.
    </p>
    <p class="leafygreen-ui-1kp3ins">
     <code class="leafygreen-ui-1l06pbn">
      Indexed
     </code>
     supports equality queries.
     <code class="leafygreen-ui-1l06pbn">
      Range
     </code>
     supports range
queries.
     <code class="leafygreen-ui-1l06pbn">
      Indexed
     </code>
     and
     <code class="leafygreen-ui-1l06pbn">
      Range
     </code>
     fields require an index on the
server. The index is created by specifying the
     <code class="leafygreen-ui-1l06pbn">
      encryptedFields
     </code>
     option in
     <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createCollection/#mongodb-method-db.createCollection">
      <code class="leafygreen-ui-1l06pbn">
       db.createCollection()
      </code>
      .
     </a>
    </p>
    <div class="leafygreen-ui-15mdk4" role="note">
     <h2 class="leafygreen-ui-6n7b7d">
      Note
     </h2>
     <div class="leafygreen-ui-9mycqc">
      <p class="leafygreen-ui-1kp3ins">
       Starting in MongoDB 8.0, the
       <code class="leafygreen-ui-1l06pbn">
        rangePreview
       </code>
       Queryable Encryption
algorithm is deprecated and removed. Use the
       <code class="leafygreen-ui-1l06pbn">
        Range
       </code>
       algorithm
instead.
      </p>
      <p class="leafygreen-ui-1kp3ins">
       If your Queryable Encryption collection uses
       <code class="leafygreen-ui-1l06pbn">
        rangePreview
       </code>
       , you must
drop the collection before you can upgrade to MongoDB 8.0.
      </p>
     </div>
    </div>
    <span class="leafygreen-ui-1qnjd6d" id="std-label-qe-fundamentals-manual-encryption-automatic-decryption">
    </span>
   </section>
  </section>
  <section>
   <h3 class="contains-headerlink leafygreen-ui-15ajumo" weight="medium">
    Automatic Decryption
    <a class="headerlink leafygreen-ui-1kepx47" href="#automatic-decryption" title="Permalink to this heading">
     <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
      <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
      </path>
      <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
      </path>
     </svg>
     <div class="css-1btu0w3 evvkmar0" id="automatic-decryption">
     </div>
    </a>
   </h3>
   <p class="leafygreen-ui-1kp3ins">
    To decrypt fields automatically, configure your
    <code class="leafygreen-ui-1l06pbn">
     MongoClient
    </code>
    instance as follows:
   </p>
   <ul class="leafygreen-ui-rioki0">
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      Specify a
      <code class="leafygreen-ui-1l06pbn">
       kmsProviders
      </code>
      object
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      Specify your Key Vault collection
     </p>
    </li>
    <li class="leafygreen-ui-d7p7b6">
     <p class="leafygreen-ui-1kp3ins">
      If you use MongoDB Community Server, set the
      <code class="leafygreen-ui-1l06pbn">
       bypassQueryAnalysis
      </code>
      option to
      <code class="leafygreen-ui-1l06pbn">
       True
      </code>
     </p>
    </li>
   </ul>
   <div class="leafygreen-ui-15mdk4" role="note">
    <h2 class="leafygreen-ui-6n7b7d">
     Note
    </h2>
    <h3 class="leafygreen-ui-144d5kf">
     <strong>
      Automatic Decryption in MongoDB Community Server
     </strong>
    </h3>
    <div class="leafygreen-ui-9mycqc">
     <p class="leafygreen-ui-1kp3ins">
      Automatic decryption is available in MongoDB Community Server.
Automatic encryption requires MongoDB Enterprise or MongoDB
Atlas.
     </p>
    </div>
   </div>
   <span class="leafygreen-ui-1qnjd6d" id="std-label-qe-fundamentals-manual-encryption-server-side-schema">
   </span>
  </section>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Server-Side Field Level Encryption Enforcement
   <a class="headerlink leafygreen-ui-1kepx47" href="#server-side-field-level-encryption-enforcement" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="server-side-field-level-encryption-enforcement">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/qe-create-encryption-schema/#std-label-qe-specify-fields-for-encryption">
    Steps
   </a>
   to enforce
encryption of specific fields in a collection.
  </p>
  <p class="leafygreen-ui-1kp3ins">
   <code class="leafygreen-ui-1l06pbn">
    Indexed
   </code>
   and
   <code class="leafygreen-ui-1l06pbn">
    Range
   </code>
   fields require an index on the server. The
index is created by specifying the
   <code class="leafygreen-ui-1l06pbn">
    encryptedFields
   </code>
   option in
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/method/db.createCollection/#mongodb-method-db.createCollection">
    <code class="leafygreen-ui-1l06pbn">
     db.createCollection()
    </code>
    .
   </a>
  </p>
  <p class="leafygreen-ui-1kp3ins">
   If your MongoDB instance enforces the encryption of specific fields, any
client performing Queryable Encryption with explicit encryption must encrypt those fields
as specified. To learn how to set up server-side Queryable Encryption
enforcement, see
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/encrypt-and-query/#std-label-qe-fundamentals-encrypt-query">
    Encrypted Fields and Enabled Queries
    <!-- -->
    .
   </a>
  </p>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Learn More
   <a class="headerlink leafygreen-ui-1kepx47" href="#learn-more" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="learn-more">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   To learn more about Key Vault collections, Data Encryption Keys, and Customer Master Keys,
see
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/keys-key-vaults/#std-label-qe-reference-keys-key-vaults">
    Encryption Keys and Key Vaults
    <!-- -->
    .
   </a>
  </p>
  <p class="leafygreen-ui-1kp3ins">
   To learn more about
   <span class="leafygreen-ui-vm4wms" tabindex="0">
    KMS
   </span>
   providers and
   <code class="leafygreen-ui-1l06pbn">
    kmsProviders
   </code>
   objects,
see
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/queryable-encryption/fundamentals/kms-providers/#std-label-qe-fundamentals-kms-providers">
    KMS Providers
    <!-- -->
    .
   </a>
  </p>
 </section>
</section>
