<section>
 <h1 class="contains-headerlink leafygreen-ui-41fr9s" weight="medium">
  Distributed Queries
  <a class="headerlink leafygreen-ui-1kepx47" href="#distributed-queries" title="Permalink to this heading">
   <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
    <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
    </path>
    <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
    </path>
   </svg>
   <div class="css-1btu0w3 evvkmar0" id="distributed-queries">
   </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="#read-operations-to-replica-sets" target="_self">
     <span>
      Read Operations to Replica Sets
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#write-operations-on-replica-sets" target="_self">
     <span>
      Write Operations on Replica Sets
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#read-operations-to-sharded-clusters" target="_self">
     <span>
      Read Operations to Sharded Clusters
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#write-operations-on-sharded-clusters" target="_self">
     <span>
      Write Operations on Sharded Clusters
     </span>
    </a>
   </li>
   <li class="leafygreen-ui-1jqtqlb">
    <a class="lg-ui-0001 leafygreen-ui-cpmeq5" href="#change-streams-and-orphan-documents" target="_self">
     <span>
      Change Streams and Orphan Documents
     </span>
    </a>
   </li>
  </ul>
 </div>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Read Operations to Replica Sets
   <a class="headerlink leafygreen-ui-1kepx47" href="#read-operations-to-replica-sets" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="read-operations-to-replica-sets">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   By default, clients reads from a replica set's
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary">
    primary
   </a>
   ;
however, clients can specify a
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/">
    read preference
   </a>
   to direct read operations to other members.
For example, clients can configure read preferences to read from
secondaries or from nearest member to:
  </p>
  <ul class="leafygreen-ui-rioki0">
   <li class="leafygreen-ui-d7p7b6">
    <p class="leafygreen-ui-1kp3ins">
     reduce latency in multi-data-center deployments,
    </p>
   </li>
   <li class="leafygreen-ui-d7p7b6">
    <p class="leafygreen-ui-1kp3ins">
     improve read throughput by distributing high read-volumes (relative
to write volume),
    </p>
   </li>
   <li class="leafygreen-ui-d7p7b6">
    <p class="leafygreen-ui-1kp3ins">
     perform backup operations, and/or
    </p>
   </li>
   <li class="leafygreen-ui-d7p7b6">
    <p class="leafygreen-ui-1kp3ins">
     allow reads until a
     <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/replica-set-high-availability/#std-label-replica-set-failover">
      new primary is elected
      <!-- -->
      .
     </a>
    </p>
   </li>
  </ul>
  <div class="css-q7r6u4 ej97su30">
   <div role="button" tabindex="-1">
    <img alt="Read operations to a replica set. Default read preference routes the read to the primary. Read preference of ``nearest`` routes the read to the nearest member." class="leafygreen-ui-1qnf57e" height="480" src="/docs/manual/images/replica-set-read-preference.bakedsvg.svg" style="--border-color:#C1C7C6" width="800"/>
    <div class="css-19pi7x2 ej97su31" style="--color:#444">
     click to enlarge
    </div>
   </div>
  </div>
  <p class="leafygreen-ui-1kp3ins">
   Read operations from secondary members of replica sets may not reflect
the current state of the primary. Read preferences that direct read
operations to different servers may result in non-monotonic reads.
  </p>
  <p class="leafygreen-ui-1kp3ins">
   Clients can use
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-isolation-consistency-recency/#std-label-causal-consistency">
    causally consistent
   </a>
   sessions, which provides various guarantees including monotonic reads.
  </p>
  <p class="leafygreen-ui-1kp3ins">
   You can configure the read preference on a per-connection or
per-operation basis. For more information on read preference or on the
read preference modes, see
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/">
    Read Preference
   </a>
   and
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-preference/#std-label-replica-set-read-preference-modes">
    Read Preference Modes
    <!-- -->
    .
   </a>
  </p>
  <span class="leafygreen-ui-1qnjd6d" id="std-label-write-operations-replica-sets">
  </span>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Write Operations on Replica Sets
   <a class="headerlink leafygreen-ui-1kepx47" href="#write-operations-on-replica-sets" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="write-operations-on-replica-sets">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   In
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-replica-set">
    replica sets
   </a>
   , all write operations go to the
set's
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-primary">
    primary
   </a>
   . The primary applies the write operation and
records the operations on the primary's operation log or
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-oplog">
    oplog
   </a>
   .
The oplog is a reproducible sequence of operations to the data set.
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-secondary">
    secondary
   </a>
   members of the set continuously replicate the oplog
and apply the operations to themselves in an asynchronous process.
  </p>
  <div class="css-18h91be ej97su30">
   <div role="button" tabindex="-1">
    <img alt="Diagram of default routing of reads and writes to the primary." class="leafygreen-ui-1qnf57e" height="507" src="/docs/manual/images/replica-set-read-write-operations-primary.bakedsvg.svg" style="--border-color:#C1C7C6" width="620"/>
    <div class="css-19pi7x2 ej97su31" style="--color:#444">
     click to enlarge
    </div>
   </div>
  </div>
  <p class="leafygreen-ui-1kp3ins">
   For more information on replica sets and write operations, see
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/replication/">
    Replication
   </a>
   and
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/write-concern/">
    Write Concern
    <!-- -->
    .
   </a>
  </p>
  <span class="leafygreen-ui-1qnjd6d" id="std-label-read-operations-sharded-clusters">
  </span>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Read Operations to Sharded Clusters
   <a class="headerlink leafygreen-ui-1kepx47" href="#read-operations-to-sharded-clusters" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="read-operations-to-sharded-clusters">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-sharded-cluster">
    Sharded clusters
   </a>
   allow you to partition a data
set among a cluster of
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongod/#mongodb-binary-bin.mongod">
    <code class="leafygreen-ui-1l06pbn">
     mongod
    </code>
   </a>
   instances in a way that is
nearly transparent to the application. For an overview of sharded
clusters, see the
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/sharding/">
    Sharding
   </a>
   section of this manual.
  </p>
  <p class="leafygreen-ui-1kp3ins">
   For a sharded cluster, applications issue operations to one of the
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos">
    <code class="leafygreen-ui-1l06pbn">
     mongos
    </code>
   </a>
   instances associated with the cluster.
  </p>
  <div class="css-18h91be ej97su30">
   <div role="button" tabindex="-1">
    <img alt="Diagram of a sharded cluster." class="leafygreen-ui-1qnf57e" height="560" src="/docs/manual/images/sharded-cluster.bakedsvg.svg" style="--border-color:#C1C7C6" width="700"/>
    <div class="css-19pi7x2 ej97su31" style="--color:#444">
     click to enlarge
    </div>
   </div>
  </div>
  <p class="leafygreen-ui-1kp3ins">
   Read operations on sharded clusters are most efficient when directed to
a specific shard. Queries to sharded collections should include the
collection's
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-shard-key/#std-label-sharding-shard-key">
    shard key
   </a>
   . When a query
includes a shard key, the
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos">
    <code class="leafygreen-ui-1l06pbn">
     mongos
    </code>
   </a>
   can use cluster metadata
from the
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-config-servers/#std-label-sharding-config-server">
    config database
   </a>
   to route the
queries to shards.
  </p>
  <div class="figure css-5vkxs0" style="width:400px">
   <img alt="Read operations to a sharded cluster. Query criteria includes the shard key. The query router ``mongos`` can target the query to the appropriate shard or shards." class="leafygreen-ui-1qnf57e" height="460" src="/docs/manual/images/sharded-cluster-targeted-query.bakedsvg.svg" style="--border-color:#C1C7C6" width="360"/>
  </div>
  <p class="leafygreen-ui-1kp3ins">
   If a query does not include the shard key, the
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos">
    <code class="leafygreen-ui-1l06pbn">
     mongos
    </code>
   </a>
   must
direct the query to
   <em>
    all
   </em>
   shards in the cluster. These
   <em>
    scatter
gather
   </em>
   queries can be inefficient. On larger clusters, scatter gather
queries are unfeasible for routine operations.
  </p>
  <div class="figure css-5vkxs0" style="width:400px">
   <img alt="Read operations to a sharded cluster. Query criteria does not include the shard key. The query router ``mongos`` must broadcast query to all shards for the collection." class="leafygreen-ui-1qnf57e" height="460" src="/docs/manual/images/sharded-cluster-scatter-gather-query.bakedsvg.svg" style="--border-color:#C1C7C6" width="360"/>
  </div>
  <p class="leafygreen-ui-1kp3ins">
   For replica set shards, read operations from secondary members of
replica sets may not reflect the current state of the primary. Read
preferences that direct read operations to different servers may result
in non-monotonic reads.
  </p>
  <div class="leafygreen-ui-15mdk4" role="note">
   <h2 class="leafygreen-ui-6n7b7d">
    Note
   </h2>
   <div class="leafygreen-ui-9mycqc">
    <ul class="leafygreen-ui-rioki0">
     <li class="leafygreen-ui-d7p7b6">
      <p class="leafygreen-ui-1kp3ins">
       Clients can use
       <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/read-isolation-consistency-recency/#std-label-causal-consistency">
        causally consistent
       </a>
       sessions, which provides various guarantees, including monotonic
reads.
      </p>
     </li>
     <li class="leafygreen-ui-d7p7b6">
      <p class="leafygreen-ui-1kp3ins">
       All members of a shard replica set, not just the primary, maintain
the metadata regarding chunk metadata. This prevents reads from
the secondaries from returning
       <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-orphaned-document">
        orphaned data
       </a>
       if not using read concern
       <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/read-concern-available/#mongodb-readconcern-readconcern.-available-">
        <code class="leafygreen-ui-1l06pbn">
         "available"
        </code>
       </a>
       .
In earlier versions, reads from secondaries, regardless of the
read concern, could return orphaned documents.
      </p>
     </li>
    </ul>
   </div>
  </div>
  <p class="leafygreen-ui-1kp3ins">
   For more information on read operations in sharded clusters, see the
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-query-router/">
    mongos
   </a>
   and
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-shard-key/#std-label-sharding-shard-key">
    Shard Keys
   </a>
   sections.
  </p>
  <span class="leafygreen-ui-1qnjd6d" id="std-label-write-operations-sharded-clusters">
  </span>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Write Operations on Sharded Clusters
   <a class="headerlink leafygreen-ui-1kepx47" href="#write-operations-on-sharded-clusters" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="write-operations-on-sharded-clusters">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   For sharded collections in a
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-sharded-cluster">
    sharded cluster
   </a>
   , the
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos">
    <code class="leafygreen-ui-1l06pbn">
     mongos
    </code>
   </a>
   directs write operations from applications to the
shards that are responsible for the specific
   <em>
    portion
   </em>
   of the data
set. The
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/program/mongos/#mongodb-binary-bin.mongos">
    <code class="leafygreen-ui-1l06pbn">
     mongos
    </code>
   </a>
   uses the cluster metadata from the
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharded-cluster-config-servers/#std-label-sharding-config-server">
    config database
   </a>
   to route the write
operation to the appropriate shards.
  </p>
  <div class="css-18h91be ej97su30">
   <div role="button" tabindex="-1">
    <img alt="Diagram of a sharded cluster." class="leafygreen-ui-1qnf57e" height="560" src="/docs/manual/images/sharded-cluster.bakedsvg.svg" style="--border-color:#C1C7C6" width="700"/>
    <div class="css-19pi7x2 ej97su31" style="--color:#444">
     click to enlarge
    </div>
   </div>
  </div>
  <p class="leafygreen-ui-1kp3ins">
   MongoDB partitions data in a sharded collection into
   <em>
    ranges
   </em>
   based on
the values of the
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key">
    shard key
   </a>
   . Then, MongoDB distributes these
chunks to shards. The shard key determines the distribution of chunks to
shards. This can affect the performance of write operations in the
cluster.
  </p>
  <div class="figure css-5vkxs0" style="width:700px">
   <img alt="Diagram of the shard key value space segmented into smaller ranges or chunks." class="leafygreen-ui-1qnf57e" height="250" src="/docs/manual/images/sharding-range-based.bakedsvg.svg" style="--border-color:#C1C7C6" width="760"/>
  </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">
     Update operations that affect a
     <em>
      single
     </em>
     document
     <strong>
      must
     </strong>
     include the
     <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key">
      shard key
     </a>
     or the
     <code class="leafygreen-ui-1l06pbn">
      _id
     </code>
     field. Updates that affect multiple documents are more efficient in
some situations if they have the
     <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-shard-key">
      shard key
     </a>
     , but can be
broadcast to all shards.
    </p>
   </div>
  </div>
  <p class="leafygreen-ui-1kp3ins">
   If the value of the shard key increases or decreases with every
insert, all insert operations target a single shard. As a result, the
capacity of a single shard becomes the limit for the insert capacity
of the sharded cluster.
  </p>
  <p class="leafygreen-ui-1kp3ins">
   For more information, see
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/sharding/">
    Sharding
   </a>
   and
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/bulk-write-operations/">
    Bulk Write Operations
    <!-- -->
    .
   </a>
  </p>
  <div class="leafygreen-ui-13vw3ie" role="note">
   <h2 class="leafygreen-ui-1fn4p2b">
    Tip
   </h2>
   <h3 class="leafygreen-ui-144d5kf">
    <strong>
     See also:
    </strong>
   </h3>
   <div class="leafygreen-ui-9mycqc">
    <p class="leafygreen-ui-1kp3ins">
     <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/retryable-writes/#std-label-retryable-writes">
      Retryable Writes
     </a>
    </p>
   </div>
  </div>
 </section>
 <section>
  <h2 class="contains-headerlink leafygreen-ui-19f71ei" weight="medium">
   Change Streams and Orphan Documents
   <a class="headerlink leafygreen-ui-1kepx47" href="#change-streams-and-orphan-documents" title="Permalink to this heading">
    <svg aria-label="Link Icon" class="leafygreen-ui-a30zj9" fill="none" height="12" role="img" viewbox="0 0 16 16" width="12" xmlns="http://www.w3.org/2000/svg">
     <path d="M6.039 9.953a3.596 3.596 0 0 1-.327-.38l1.45-1.445a1.553 1.553 0 0 0 2.496.423l2.885-2.87a1.57 1.57 0 0 0 .01-2.213 1.553 1.553 0 0 0-2.203-.01l-.379.377A.995.995 0 0 1 8.56 3.83a1.005 1.005 0 0 1 .006-1.418l.38-.377a3.542 3.542 0 0 1 5.024.023 3.58 3.58 0 0 1-.022 5.047l-2.884 2.871a3.542 3.542 0 0 1-5.025-.022Z" fill="currentColor">
     </path>
     <path d="M9.961 6.047c.12.12.228.248.327.38l-1.45 1.445a1.553 1.553 0 0 0-2.496-.423l-2.885 2.87a1.57 1.57 0 0 0-.01 2.213 1.553 1.553 0 0 0 2.203.01l.379-.377a.995.995 0 0 1 1.411.006 1.005 1.005 0 0 1-.006 1.418l-.38.377a3.542 3.542 0 0 1-5.024-.023 3.58 3.58 0 0 1 .022-5.047l2.884-2.871a3.542 3.542 0 0 1 5.025.022Z" fill="currentColor">
     </path>
    </svg>
    <div class="css-1btu0w3 evvkmar0" id="change-streams-and-orphan-documents">
    </div>
   </a>
  </h2>
  <p class="leafygreen-ui-1kp3ins">
   Starting in MongoDB 5.3, during
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/core/sharding-balancer-administration/#std-label-range-migration-procedure">
    range migration
   </a>
   ,
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/changeStreams/#std-label-changeStreams">
    change stream
   </a>
   events are not generated for updates to
   <a class="leafygreen-ui-tqgtui" href="/docs/manual/reference/glossary/#std-term-orphaned-document">
    orphaned documents
    <!-- -->
    .
   </a>
  </p>
  <span class="leafygreen-ui-1qnjd6d" id="std-label-read-operations-connection-pooling">
  </span>
 </section>
</section>
